view docs/ccguide/fseek.refentry @ 2798:b70d93f8d7ce lwtools-port

Updated coco1/modules/makefile and coco3/modules/makefile to help resolve issues with i(x) and s(x) descriptors. Updated level1/coco1/modules/makefile & level2/coco3/modules/makefile so that correct values would be sent to assembler when building superdesc.asm for s(x).dd and i(x).dd descriptors.
author drencor-xeen
date Mon, 28 Jan 2013 16:13:05 -0600
parents fe8e46eca1ed
children
line wrap: on
line source

<refentry id="fseek">
<refnamediv>
<refname>Fseek</refname>
<refname>Rewind</refname>
<refname>Ftell</refname>
<refpurpose>position in a file or report current position</refpurpose>
</refnamediv>

<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>
#include &lt;stdio.h&gt;
</funcsynopsisinfo>

<funcprototype>
  <funcdef><function>fseek</function></funcdef>
  <paramdef>FILE *<parameter>fp</parameter></paramdef>
  <paramdef>long <parameter>offset</parameter></paramdef>
  <paramdef>int <parameter>place</parameter></paramdef>
</funcprototype>

<funcprototype>
  <funcdef><function>rewind</function></funcdef>
  <paramdef>FILE *<parameter>fp</parameter></paramdef>
</funcprototype>

<funcprototype>
  <funcdef>long <function>ftell</function></funcdef>
  <paramdef>FILE *<parameter>fp</parameter></paramdef>
</funcprototype>
</funcsynopsis>

</refsynopsisdiv>

<refsect1><title>Description</title>
<para>
Fseek repositions the next character position of a file for
either read or write. The new position is a "offset" bytes
from the beginning of the file if "place" is 0, the current
position is 1, or the end if 2. Fseek sorts out the special
problems of buffering.
</para>
<para>
NOTE that using "lseek()" on a buffered file will produce
unpredictable results.
</para>
<para>
Rewind is equivalent to "fseek(fp,0L,0)".
</para>
<para>
Ftell returns the current position, measured in bytes, from the
beginning of the file pointed to by "fp".
</para>
</refsect1>

<refsect1><title>Diagnostics</title>
<para>
Fseek returns -1 if the call is invalid.
</para>
</refsect1>

<refsect1><title>See Also</title>
<para>
System call
<link linkend="lseek">lseek()</link>.
</para>
</refsect1>

</refentry>