Guardian C Library Calls Reference Manual
fseek
3-66 128833—Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
fseek
The fseek function sets the file-position indicator of a byte-addressable file opened for
ANSI I/O.
stream
denotes a file opened for ANSI I/O.
pos
specifies the desired file position.
pos_base
is one of the following alternatives:
•
SEEK_SET indicates that pos is the number of characters from the beginning of
the file.
•
SEEK_CUR indicates that pos is the number of characters from the current file
position.
•
SEEK_END indicates that pos is the number of characters from the end of the
file.
Return Value
is zero if the operation is successful or a nonzero value if an error occurs.
Usage Guidelines
•
The fseek function sets the file-position indicator to the signed offset distance from
the beginning, current position, or end of file, according to the pos_base you specify.
•
The fseek function has no effect if the file does not support positioning requests (a
terminal, for example). Such an unsupported request is not an error, so fseek still
returns zero.
•
The fseek function undoes any effects of ungetc.
•
The fseek function resets the end-of-file and error indicators.
#include <stdioh>
int fseek(FILE *stream, long pos, int pos_base);