## f_unlink

The f_unlink removes file or directory.

    FRESULT f_unlink (
      const char* FileName  /* Pointer to the file or directory name */
    );

#### Parameter

FileName
  Pointer to the null-terminated string that specifies a file or directory to be removed.

#### Return Values

FR_OK (0)
  The function succeeded.
FR_NO_FILE
  Could not find the file or directory.
FR_NO_PATH
  Could not find the path.
FR_INVALID_NAME
  The path name is invalid.
FR_INVALID_DRIVE
  The drive number is invalid.
FR_DENIED
  The function was denied due to either of following reasons:
  - The file or directory has read-only attribute
  - The directory is not empty.
FR_NOT_READY
  The disk drive cannot work due to no medium in the drive or any other reason.
FR_WRITE_PROTECTED
  The medium is write protected.
FR_DISK_ERR
  The function failed due to an error in the disk function.
FR_INT_ERR
  The function failed due to a wrong FAT structure or an internal error.
FR_NOT_ENABLED
  The logical drive has no work area.
FR_NO_FILESYSTEM
  There is no valid FAT partition on the disk.

#### Description

The f_unlink function removes a file or directory. In read-only configuration or minimization level is >= 1, this function is not available.

Return