<< Previous | Next >>

fat_Truncate

int fat_Truncate( FATfile *file, long where );

Description

Truncates the file at where and frees any left over allocated clusters. The file must be a FAT_FILE type.

Parameters

file
Pointer to the open file to truncate.

where
One of the following:

  • 0 - absolute byte to truncate the file. The file is truncated at EOF if the absolute byte is beyond EOF.

  • FAT_BRK_END - truncate at EOF.

  • FAT_BRK_POS - truncate at current file position.

Return Value

0: success.
-EIO: device I/O error.
-EINVAL: file is invalid.
-EPERM: file is in use, write-protected, hidden, or system.
-ENOENT: the file does not exist.
-ETYPE: file is not a FAT file type.
-EBUSY: the device is busy (Only if non-blocking).
-EFSTATE: if file in inappropriate state (Only if non-blocking)

Library

FAT.LIB

See Also

fat_Open, fat_OpenDir, fat_Delete, fat_Split


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