f_rmdir


Use this function to remove a directory.

The function returns an error code if:

  • The target directory is not empty.
  • The directory is read-only.

Format

int f_rmdir ( const char * path)

Arguments

Argument Description Type
path The name of the directory to remove. const char *

Return values

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

Example

void myfunc()
{
        .
    f_mkdir( "subfolder" );   /* Create directories */
    f_mkdir( "subfolder/sub1" );
        .
        .  /* Do some work */
        .
    f_rmdir( "subfolder/sub1" ); /* Remove directories */
    f_rmdir( "subfolder" );   
        .
        .
}