72 lines
1.9 KiB
HTML
72 lines
1.9 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>fseek(3)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>fseek(3)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
fseek, ftell, rewind - reposition a stream
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>#include</STRONG> <STRONG><stdio.h></STRONG>
|
|
|
|
<STRONG>int</STRONG> <STRONG>fseek(FILE</STRONG> <STRONG>*</STRONG><EM>stream</EM><STRONG>,</STRONG> <STRONG>long</STRONG> <EM>offset</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>ptrname</EM><STRONG>)</STRONG>
|
|
<STRONG>long</STRONG> <STRONG>ftell(FILE</STRONG> <STRONG>*</STRONG><EM>stream</EM><STRONG>)</STRONG>
|
|
<STRONG>void</STRONG> <STRONG>rewind(FILE</STRONG> <STRONG>*</STRONG><EM>stream</EM><STRONG>)</STRONG>
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
<STRONG>Fseek</STRONG> sets the position of the next input or output operation on the
|
|
<EM>stream</EM>. The new position is at the signed distance <EM>offset</EM> bytes from the
|
|
beginning, the current position, or the end of the file, according as
|
|
<EM>ptrname</EM> has the value 0, 1, or 2.
|
|
|
|
<STRONG>Fseek</STRONG> undoes any effects of <STRONG><A HREF="../man3/ungetc.3.html">ungetc(3)</A></STRONG>.
|
|
|
|
<STRONG>Ftell</STRONG> returns the current value of the offset relative to the beginning
|
|
of the file associated with the named <EM>stream</EM>. It is measured in bytes on
|
|
UNIX; on some other systems it is a magic cookie, and the only foolproof
|
|
way to obtain an <EM>offset</EM> for <STRONG>fseek</STRONG>.
|
|
|
|
<STRONG>Rewind</STRONG>(<EM>stream</EM>) is equivalent to <STRONG>fseek</STRONG>(<EM>stream</EM>, 0L, 0).
|
|
|
|
|
|
</PRE>
|
|
<H2>SEE ALSO</H2><PRE>
|
|
<STRONG><A HREF="../man2/lseek.2.html">lseek(2)</A></STRONG>, <STRONG><A HREF="../man3/fopen.3.html">fopen(3)</A></STRONG>.
|
|
|
|
|
|
</PRE>
|
|
<H2>DIAGNOSTICS</H2><PRE>
|
|
<STRONG>Fseek</STRONG> returns -1 for improper seeks, otherwise zero.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|