![]() |
|
| << Previous | Next >> | |
| | |
int fat_Split( FATfile *file, long where, char *newfile );
Description
- Splits the original file at
whereand assigns any left over allocated clusters tonewfile. As the name implies,newfileis 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 typeFAT_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-EBUSYreturns 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:filehas invalid references.
-EPATHSTR:newfileis not a valid path/name string.
-EEOF: no unused clusters are available fornewfile.filewill be unchanged and open,newfileis not created.
-EPERM:fileis in use, write-protected, hidden, or system.
-ENOENT:filedoes not exist.
-ETYPE:fileis 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 |