Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
fgetpos, fsetpos
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The fgetpos function gets the current value of <stream>'s file-
position indicator and stores it in the object pointed to by <pos>.
Later, the fsetpos function uses information stored in <pos> to
reset a stream's pointer to its position at the time fgetpos was
called.
The fsetpos function sets the file-position indicator for <stream>
to the value of <pos>, which is obtained in a prior call to
fgetpos against <stream>. The fsetpos function clears the end-of-
file indicator and undoes any effects of the ungetc function on
<stream>. After calling fsetpos, the next operation on <stream>
may be either input or output.
The <pos> value is stored in an internal format and is intended
for use only by the fgetpos and fsetpos functions.
Return Value
If successful, the fgetpos and fsetpos functions return 0. On
failure, they return a nonzero value and set errno to EINVAL or
EBADF.
-♦-