<< Previous | Next >>

fat_CreateDir

int fat_CreateDir( fat_part *part, char *dirname );

Description

Creates a directory if it does not already exist. The parent directory must already exist.

In non-blocking mode, only one file or directory can be created at any one time, since a single static FATfile is used for temporary storage. Each time you call this function, pass the same dirname pointer (not just the same string contents).

Parameters

part
Handle for the partition being used.

dirname
Pointer to the full path name of the directory to be created.

Return Value

0: success.
-EINVAL: invalid argument. Trying to create volume label.
-ENOENT: parent directory does not exist.
-EPERM: the directory already exists or is write-protected.
-EBUSY: the device is busy (only if non-blocking).
-EFSTATE: if non-blocking, but a previous sequence of calls to this function (or fat_CreateFile()) has not completed and you are trying to create a different file or directory. You must complete the sequence of calls for each file or directory i.e., keep calling until something other than -EBUSY is returned.

Other negative values are possible from fat_Open()/fat_Close() calls.

Library

FAT.LIB

See Also

fat_ReadDir, fat_Status, fat_Open, fat_CreateFile


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