1FSEEK(3S)                                                            FSEEK(3S)
2
3
4

NAME

6       fseek, ftell, rewind - reposition a stream
7

SYNOPSIS

9       #include <stdio.h>
10
11       fseek(stream, offset, ptrname)
12       FILE *stream;
13       long offset;
14
15       long ftell(stream)
16       FILE *stream;
17
18       rewind(stream)
19

DESCRIPTION

21       Fseek  sets  the  position of the next input or output operation on the
22       stream.  The new position is at the signed distance offset  bytes  from
23       the  beginning, the current position, or the end of the file, according
24       as ptrname has the value 0, 1, or 2.
25
26       Fseek undoes any effects of ungetc(3S).
27
28       Ftell returns the current value of the offset relative to the beginning
29       of  the file associated with the named stream.  It is measured in bytes
30       on UNIX; on some other systems it is a magic cookie, and the only fool‐
31       proof way to obtain an offset for fseek.
32
33       Rewind(stream) is equivalent to fseek(stream, 0L, 0).
34

SEE ALSO

36       lseek(2), fopen(3S)
37

DIAGNOSTICS

39       Fseek returns -1 for improper seeks, otherwise zero.
40
41
42
437th Edition                    February 24, 1986                     FSEEK(3S)
Impressum