Manual Page Result
0
Command: fseek | Section: 3 | Source: UNIX v10 | File: fseek.3
FSEEK(3S) FSEEK(3S)
NAME
fseek, ftell, rewind - reposition a stream
SYNOPSIS
#include <stdio.h>
int fseek(stream, offset, ptrname)
FILE *stream;
long offset;
long ftell(stream)
FILE *stream;
int rewind(stream)
DESCRIPTION
Fseek sets the position of the next input or output operation on the
stream. The new position is at the signed distance offset bytes from
the beginning, the current position, or the end of the file, as ptrname
has the value 0, 1 or 2 respectively.
Ftell returns the current value of the file pointer for the file asso-
ciated with the named stream.
Rewind(stream) is equivalent to fseek(stream, 0L, 0).
SEE ALSO
lseek(2), stdio(3)
DIAGNOSTICS
Fseek returns -1 for improper seeks. Ftell returns -1 if seeking is
impossible.
BUGS
The interaction of fseek and ungetc(3) is undefined.
FSEEK(3S)