#include <unistd.h> int ftruncate64(int file_descriptor, off64_t length);Service Program Name: QP0LLIB1
The ftruncate64() function truncates the file indicated by the open file descriptor file_descriptor to the indicated length. file_descriptor must be a "regular file" that is open for writing. (A regular file is a stream file that can support positioning the file offset.) If the file size exceeds length, any extra data is discarded. If the file size is smaller than length, the file is extended and filled with binary zeros to the indicated length. (In the QSYS.LIB and independent ASP QSYS.LIB file systems, blanks are used instead of zeros to pad records after a member is extended.) The ftruncate64() function does not modify the current file offset for any open file descriptions associated with the file.
ftruncate64() is enabled for large files. It is capable of operating on files larger than 2GB minus 1 byte as long as the file has been opened by either of the following:
If ftruncate64() completes successfully, it marks the change time and modification times of the file. If ftruncate64() is not successful, the file is unchanged.
For additional information about parameters, authorities, error conditions, and examples, see ftruncate()--Truncate File.
Although QFileSvr.400 does not support large files, it will return [EFBIG] if the length specified is greater than 2GB minus 1 byte.
Top | UNIX-Type APIs | APIs by category |