1.2.7.4.33 SYS_FS_FileDirectoryRemove Function

1.2.7.4.33 C

SYS_FS_RESULT SYS_FS_FileDirectoryRemove
(
    const char* path
);

1.2.7.4.33 Summary

Removes a file or directory.

1.2.7.4.33 Description

This function removes a file or directory as specified by the path.

1.2.7.4.33 Precondition

  • The disk has to be mounted before a directory could be removed

  • The file or directory to be removed has to present

  • The file/sub-directory must not have read-only attribute (AM_RDO), or the function will be rejected with FR_DENIED

  • The sub-directory must be empty and must not be current directory, or the function will be rejected with FR_DENIED

  • The file/sub-directory must not be opened

1.2.7.4.33 Parameters

ParametersDescription
pathPath of the File or directory to be removed

1.2.7.4.33 Returns

SYS_FS_RES_SUCCESS - Indicates that the file or directory remove operation was successful.

SYS_FS_RES_FAILURE - Indicates that the file or directory remove operation was unsuccessful. The reason for the failure can be retrieved with SYS_FS_Error.

1.2.7.4.33 Example

SYS_FS_RESULT res;

res = SYS_FS_FileDirectoryRemove("Dir1");

if(res == SYS_FS_RES_FAILURE)
{
    // Directory remove operation failed
}

1.2.7.4.33 Remarks

None.