FSEEK.3
上传用户:jnzhq888
上传日期:2007-01-18
资源大小:51694k
文件大小:1k
- ." @(#)fseek.3s 6.3 (Berkeley) 2/24/86
- ."
- .TH FSEEK 3 "February 24, 1986"
- .AT 3
- .SH NAME
- fseek, ftell, rewind - reposition a stream
- .SH SYNOPSIS
- .nf
- .ft B
- #include <stdio.h>
- int fseek(FILE *fIstreamfP, long fIoffsetfP, int fIptrnamefP)
- long ftell(FILE *fIstreamfP)
- void rewind(FILE *fIstreamfP)
- .ft R
- .fi
- .SH DESCRIPTION
- .B 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,
- according as
- .I ptrname
- has the value 0, 1, or 2.
- .PP
- .B Fseek
- undoes any effects of
- .BR ungetc (3).
- .PP
- .B Ftell
- returns the current value of the offset relative to the beginning
- of the file associated with the named
- .IR stream .
- It is measured in bytes on UNIX;
- on some other systems it is a magic cookie,
- and the only foolproof way to obtain an
- .I offset
- for
- .BR fseek .
- .PP
- .BR Rewind "(fIstreamfR)"
- is equivalent to
- .BR fseek "(fIstreamfR, 0L, 0)."
- .SH "SEE ALSO"
- .BR lseek (2),
- .BR fopen (3).
- .SH DIAGNOSTICS
- .B Fseek
- returns -1 for improper seeks, otherwise zero.