SPRUIG8J January 2018 – March 2024
Set File Position Indicator
#include <file.h>
off_t lseek (int file_descriptor , off_toffset , intorigin );
The lseek function sets the file position indicator for the given file to a location relative to the specified origin. The file position indicator measures the position in characters from the beginning of the file.
SEEK_SET (0x0000) Beginning of file
SEEK_CUR (0x0001) Current value of the file position indicator
SEEK_END (0x0002) End of file
The return value is one of the following:
# | new value of the file position indicator if successful |
(off_t)-1 | on failure |