blob: 02e0e12545e09a1f0c2c128e87e9b2ee7193c4c2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
.TH FSEEK 3S
.CT 2 file_io
.SH NAME
fseek, ftell, rewind \(mi reposition a stream
.SH SYNOPSIS
.nf
.B #include <stdio.h>
.PP
.B int fseek(stream, offset, ptrname)
.B FILE *stream;
.B long offset;
.PP
.B long ftell(stream)
.B FILE *stream;
.PP
.B int rewind(stream)
.fi
.SH DESCRIPTION
.I Fseek
sets the position of the next input or output
operation on the
.IR stream .
The new position is at the signed distance
.I offset
bytes
from the beginning, the current position, or the end of the file,
as
.I ptrname
has the value 0, 1 or 2 respectively.
.PP
.I Ftell
returns the current value of the file pointer for the file
associated with the named
.IR stream .
.PP
.IR Rewind ( stream )
is equivalent to
.BR "fseek(stream, 0L, 0)" .
.SH "SEE ALSO"
.IR lseek (2),
.IR stdio (3)
.SH DIAGNOSTICS
.I Fseek
returns \-1
for improper seeks.
.SH BUGS
The interaction of
.I fseek
and
.IR ungetc (3)
is undefined.
|