Use this function to set the file or directory attribute/permission field associated with a file.

The number of bits in the attr attribute field is determined by the F_ATTR_SIZE setting in the config.h file. All of those bits are freely programmable except the F_ATTR_DIR directory attribute bit (also defined in config.h).


int f_setpermission (
    const char *   filename,
    F_ATTR_TYPE    attr)


Argument Description Type
filename The name of the file or directory. char *
attr The 32 bit number to associate with the file or directory name. F_ATTR_TYPE

Return values

Return value Description
F_NOERR Successful execution.
Else See Error Codes.


void myfunc( void ) 
    f_mkdir( "subfolder" );    /* Create directory */
    f_setpermission( "subfolder", 0x00FF0000 );