Mono Class Library: Mono.Unix.Native.Syscall Overview | MembersMono.Unix.Native.Syscall.ftruncate Method |
Truncate or extend a file to length [Edit]
|
On success, zero is returned. On error, -1 is returned and Stdlib.GetLastError returns the translated error.
Usage
The ftruncate() system call succeeds unless:
[Edit]
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.
The truncate() system call causes the file named by path or referenced by fd to be truncated or extended to length bytes in size. If the file was larger than this size, the extra data is lost. If the file was smaller than this size, it will be extended as if by writing bytes with the value zero. With ftruncate(), the file must be open for writing. [Edit]
Namespace: Mono.Unix.Native
Assembly: Mono.Posix (in Mono.Posix.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0