int truncate(const char *pathname, off_t length);
int truncate64(const char *pathname, off64_t length);
If the file was previously longer than length, bytes past length are lost. If the file was shorter, bytes between the old and the new length are read in as zeros. The effective user ID of the process must have write permission for the file.
A component of the path prefix denies search permission, or write permission is denied on the file.
A signal interrupted the call.
The length argument was less than 0.
The named file is a directory.
A component of pathname does not name an existing file, or pathname is an empty string.
A component of the path prefix of path is not a directory.
The file exists, mandatory file/record locking is set, and there are outstanding record locks on the file.
The file referred to by pathname is a pure procedure (shared text) file that is being executed.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.3 Documentation Build 39.