#include <unistd.h> off64_t lseek64(int file_descriptor, off64_t offset, int whence);Service Program Name: QP0LLIB1
The lseek64() function changes the current file offset to a new position in the file. The new position is the given byte offset from the position specified by whence. After you have used lseek64() to seek to a new location, the next I/O operation on the file begins at that location.
lseek64() lets you specify new file offsets past the current end of the file. If data is written at such a point, read operations in the gap between this data and the old end of the file will return bytes containing binary zeros (or bytes containing blanks in the QSYS.LIB or independent ASP QSYS.LIB file systems). In other words, the gap is assumed to be filled with zeros (or with blanks in the QSYS.LIB or independent ASP QSYS.LIB file systems). If you seek past the end of a file, however, the length of the file is not automatically extended. The maximum offset that can be specified is the largest value that can be held in an 8-byte, signed integer. You must do a write operation before the file is actually extended.
In the QSYS.LIB or independent ASP QSYS.LIB file systems, you can seek only to the beginning of a member while in text mode.
lseek64() 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:
For additional information about parameters, authorities required, error conditions and examples, see lseek()--Set File Read/Write Offset.
Top | UNIX-Type APIs | APIs by category |