>>-trunc--pathname--file_size----------------------------------><
Function
trunc invokes the trunc callable service to change the
size of the file identified by pathname.
Parameters
- pathname
- The pathname of the file.
- file_size
- The new size of the file, in bytes.
Usage notes
- The file specified must be a regular file to which the calling
process has write access.
- The file size changes beginning from the first byte of the file.
If the file was previously larger than the new size, the data from file_size to the original end of the file is removed. If the file was
previously shorter than file_size, bytes between the old
and new lengths are read as zeros.
- If file_size is greater than the current file size limit
for the process, the request fails with EFBIG, and the SIGXFSZ signal
is generated for the process.
Example
To set the file size of
/tmp/xxx to 1000
bytes:
"trunc /tmp/xxx 1000"