- path
- Documentation for this section has not yet been entered.
- length
- Documentation for this section has not yet been entered.
On success, zero is returned. On error, -1 is returned and Stdlib.GetLastError returns the translated error.
Usage
The truncate() system call succeeds unless:
Error Details Errno.ENOTDIR A component of the path prefix is not a directory.
Errno.ENAMETOOLONG A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.
Errno.ENOENT The named file does not exist.
Errno.EACCES Search permission is denied for a component of the path prefix.
Errno.EACCES The named file is not writable by the user.
Errno.ELOOP Too many symbolic links were encountered in translating the pathname.
Errno.EISDIR The named file is a directory.
Errno.EROFS The named file resides on a read-only file system.
Errno.ETXTBSY The file is a pure procedure (shared text) file that is being executed.
Errno.EIO An I/O error occurred updating the inode.
Errno.EFAULT The path argument points outside the process's allocated address space.
The ftruncate() system call succeeds unless:
Error Details Errno.EBADF The fd argument is not a valid descriptor.
Errno.EINVAL The fd argument references a socket, not a file.
Errno.EINVAL The fd descriptor is not open for writing.