<< Previous | Next >>

fat_Split

int fat_Split( FATfile *file, long where, char *newfile );

Description

Splits the original file at where and assigns any left over allocated clusters to newfile. As the name implies, newfile is a newly created file that must not already exist. Upon completion, the original file is closed and the file handle is returned pointing to the created and opened new file. The file handle given must point to a file of type FAT_FILE. There are internal static variables used in this function, so only one file split operation can be active. Additional requests will be held off with -EBUSY returns until the active split completes.

Parameters

file
Pointer to the open file to split.

where
May be one of the following:

· 0 - absolute byte to split the file. If the absolute byte is beyond the EOF, file is split at EOF.
· FAT_BRK_END - split at EOF.
· FAT_BRK_POS - split at current file position.
newfile
Pointer to the absolute path and name of the new file created for the split.

Return Value

0: success.
-EIO: device I/O error.
-EINVAL: file has invalid references.
-EPATHSTR: newfile is not a valid path/name string.
-EEOF: no unused clusters are available for newfile. file will be unchanged and open, newfile is not created.
-EPERM: file is in use, write-protected, hidden, or system.
-ENOENT: file does not exist.
-ETYPE: file is not a FAT file type.
-EBUSY: the device is busy (Only non-blocking mode).
-EFSTATE: if file in inappropriate state (Only non-blocking mode).

Library

FAT.LIB

See Also

fat_Open, fat_OpenDir, fat_Delete, fat_Truncate, fat_Close


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