Changes the file position indicator of a stream.
#include <stdio.h> int fseek64 ( FILE *fp, fpos64_t offset, int whence);
(IN) Points to the file.
(IN) Specifies the file position to seek.
(IN) Specifies the relative file position and uses one of the following flags:
If successful, returns 0. Otherwise, returns -1 and sets errno to one of the following:
The fseek64 function changes the read/write position of the file specified by fp. This position defines the character to be read or written on the next I/O operation on the file. The fp parameter is a file pointer returned by fopen or freopen. The offset parameter is the position to seek, relative to one of three positions specified by the whence parameter.
The fseek64 function clears the end-of-file indicator and undoes any effects of the ungetc function on the same file.
When operating on a text file, you can only set the whence parameter to SEEK_SET and you can only set the offset parameter to 0 or a value obtained from ftell64. Any other combinations have indeterminate results. You can restore a position by using the value returned by ftell64 in a subsequent call to fseek64 with the whence parameter set to SEEK_SET.
The fseek64 function is equivalent to fseek except that it handles files larger than 2 GB.