<< Previous | Next >>

fat_Delete

int fat_Delete( fat_part *part, int type, char *name );

Description

Deletes the specified file or directory. The type must match or the deletion will not occur. This routine inserts a deletion code into the directory entry and marks the sectors as available in the FAT table, but does not actually destroy the data contained in the sectors. This allows an undelete function to be implemented, but such a routine is not part of this library. A directory must be empty to be deleted.

Parameters

part
Handle for the partition being used.

type
Must be a FAT file (FAT_FILE) or a FAT directory (FAT_DIR), depending on what is to be deleted.

name
Pointer to the full path name of the file/directory to be deleted.

Return Value

0: success.
-EIO: device I/O error.
-EINVAL: part, type, or name contain invalid values.
-EPATHSTR: name is not a valid path/name string.
-EPERM: the file is open, write-protected, hidden, or system.
-ENOTEMPTY: the directory is not empty.
-ENOENT: the file/directory does not exist.
-EBUSY: the device is busy. (Only if non-blocking.)
-EPSTATE: if the partition is busy; i.e., there is an allocation in progress. (Only if non-blocking.)

Library

FAT.LIB

See Also

fat_Open, fat_OpenDir, fat_Split, fat_Truncate, fat_Close


Dynamic C Functions << Previous | Next >> rabbit.com