source: trunk/minix/man/man3/fseek.3@ 15

Last change on this file since 15 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.1 KB
RevLine 
[9]1.\" @(#)fseek.3s 6.3 (Berkeley) 2/24/86
2.\"
3.TH FSEEK 3 "February 24, 1986"
4.AT 3
5.SH NAME
6fseek, ftell, rewind \- reposition a stream
7.SH SYNOPSIS
8.nf
9.ft B
10#include <stdio.h>
11
12int fseek(FILE *\fIstream\fP, long \fIoffset\fP, int \fIptrname\fP)
13long ftell(FILE *\fIstream\fP)
14void rewind(FILE *\fIstream\fP)
15.ft R
16.fi
17.SH DESCRIPTION
18.B Fseek
19sets the position of the next input or output
20operation on the
21.IR stream .
22The new position is at the signed distance
23.I offset
24bytes
25from the beginning, the current position, or the end of the file,
26according as
27.I ptrname
28has the value 0, 1, or 2.
29.PP
30.B Fseek
31undoes any effects of
32.BR ungetc (3).
33.PP
34.B Ftell
35returns the current value of the offset relative to the beginning
36of the file associated with the named
37.IR stream .
38It is measured in bytes on UNIX;
39on some other systems it is a magic cookie,
40and the only foolproof way to obtain an
41.I offset
42for
43.BR fseek .
44.PP
45.BR Rewind "(\fIstream\fR)"
46is equivalent to
47.BR fseek "(\fIstream\fR, 0L, 0)."
48.SH "SEE ALSO"
49.BR lseek (2),
50.BR fopen (3).
51.SH DIAGNOSTICS
52.B Fseek
53returns \-1 for improper seeks, otherwise zero.
Note: See TracBrowser for help on using the repository browser.