z/OS Using REXX and z/OS UNIX System Services
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


trunc

z/OS Using REXX and z/OS UNIX System Services
SA23-2283-00

Read syntax diagramSkip visual syntax diagram
>>-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

  1. The file specified must be a regular file to which the calling process has write access.
  2. 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.
  3. 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"

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014