C
BYTE FILEallocate_new_cluster( FILEOBJ fo, BYTE mode );
Description
This function will find an empty cluster on the device using the FATfindEmptyCluster function. It will then mark it as the last cluster in the file in the FAT chain, and link the current last cluster of the passed file to the new cluster. If the new cluster is a directory cluster, it will be erased (so there are no extraneous directory entries). If it's allocated to a non-directory file, it doesn't need to be erased; extraneous data in the cluster will be unviewable because of the file size parameter.
Preconditions
Should not be called by the user.
Parameters
Parameters |
Description |
fo |
Pointer to file structure |
mode |
|
Return Values
Return Values |
Description |
CE_GOOD |
Cluster allocated |
CE_DISK_FULL |
No clusters available |
Side Effects
None
Remarks
None.