int fsetpos(FILE *stream,
const fpos_t *pos);
int fsetpos64(FILE *stream,
const fpos64_t *pos);
The fsetpos() function repositions a file position
indicator for a stream. The positional information stored in the structure
pointed to by pos must be a value obtained by an earlier call
to fgetpos() on the same stream.
A successful call to fsetpos() clears the end-of-file
indicator for the stream and undoes any effects of ungetc()
on the same stream.
After a fsetpos() call, the next operation on an update
stream may be either input or output.
The fsetpos64() function is identical to the
fsetpos() function except that it is capable of
dealing with disk files that are larger than 2 gigabytes.
The fsetpos64() function is a part of the large
Points to the stream whose file position indicator is to be changed.
Points to a structure that holds positional information.
If successful, the fsetpos() and
fsetpos64() function return zero.
On failure, they return non-zero and errno is set to one of
the following values:
The O_NONBLOCK flag is set for the file
descriptor underlying stream, and the process
would be delayed in the write operation.
The file descriptor underlying stream
is not valid.
A signal interrupted the call.
The whence argument is invalid.
There was no free space
remaining on the device containing the file.
The file underlying stream
is a pipe or a FIFO.
fsetpos64(): Large File Specification, revision 1.5.
If the stream is writable, and there is buffered data which has not yet
been written to the file, fsetpos() and
fsetpos64() cause the unwritten
data to be written before the file position indicator is moved.
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(),
to ensure the accuracy of these functions.
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
- fgetpos(), fseek(), lseek()
PTC MKS Toolkit 10.2 Documentation Build 28.