int fgetpos(FILE *stream,
int fgetpos64(FILE *stream,
The fgetpos() function stores the current value of
the file position indicator for the stream pointed to by
stream in the object pointed to by pos.
The value stored contains information that the fsetpos()
function uses to reposition the stream to its position at the time of
the call to the fgetpos() function.
The fgetpos64() function is identical to the
fgetpos() function except that it is capable of
dealing with disk files that are larger than 2 gigabytes.
The fgetpos64() function is a part of the
large file extensions.
Is the stream whose positional information is desired.
Points to the structure that is to hold the positional information.
If successful, the fgetpos()
and fgetpos64() functions return zero.
On failure, they return non-zero, and errno is set to one of
the following values:
The file descriptor underlying stream is not valid.
The current value of the file position cannot be represented correctly
in an object of type fpos_t or off_t.
The file descriptor underlying stream
is associated with a pipe or FIFO.
fgetpos64(): Large File Specification, revision 1.5.
The file positions reported by fgetpos(),
or ftello() may be incorrect for files that are
open in text mode in the case that the file is being read, or the
case where the file is being written to and there is buffered
data which has not yet been written to the underlying file. In
the case that the file is being written to, fflush()
can be used prior to calling fgetpos(),
ftello() to ensure the accuracy of
Text mode files with no buffering do not have this problem;
however, performance can be significantly degraded with buffering turned off.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
- fseek(), fsetpos(), lseek(), ungetc()
PTC MKS Toolkit 10.2 Documentation Build 28.