Syntax | #include <unistd.h> int ftruncate (int fildes, off_t length); | |
Description |
The effect of If the request would cause the file size to exceed the current limit defined for the process for the maximum length of a file, the function is not executed and the system sends the These functions do not change the current position in the file. On successful execution, if the file size was changed, these functions update the There is no difference in functionality between | |
Return val. | 0 -1 | if successful. if an error occurs. |
Errors | ftruncate(), | |
|
| A signal was received during execution. |
|
| The value of length is negative. |
|
| |
The value of length is greater than the maximum permissible file size. | ||
|
| An I/O error occurred when reading from or writing to the file system. |
| Extension | |
| EINVAL | An attempt was made to access a BS2000 file. (End) |
| ftruncate() and
| |
fildes is not a file descriptor that is opened for writing. | ||
|
| fildes identifies a file that was opened for reading only. |
| truncate() and | |
|
| No search authorization exists for a component of the path prefix or no write authorization exists for the file addressed via path. |
|
| The file addressed via path is a directory. |
|
| Too many symbolic links were encountered in resolving path. |
|
| |
The length of a component of the pathname exceeds The resolving of symbolic links in the pathname leads to an interim result whose length exceeds | ||
|
| Either a component of the path prefix does not exist, or path references an empty string. |
|
| A component of the path prefix from path is not a directory. |
|
| The file addressed via path resides on a read-only file system. |
Notes | ftruncate(), | |
See also |
|