466
|
1 <refentry id="fseek">
|
|
2 <refnamediv>
|
570
|
3 <refname>Fseek</refname>
|
|
4 <refname>Rewind</refname>
|
|
5 <refname>Ftell</refname>
|
|
6 <refpurpose>position in a file or report current position</refpurpose>
|
466
|
7 </refnamediv>
|
|
8
|
|
9 <refsynopsisdiv>
|
|
10 <funcsynopsis>
|
468
|
11 <funcsynopsisinfo>
|
|
12 #include <stdio.h>
|
|
13 </funcsynopsisinfo>
|
570
|
14
|
466
|
15 <funcprototype>
|
|
16 <funcdef><function>fseek</function></funcdef>
|
570
|
17 <paramdef>FILE *<parameter>fp</parameter></paramdef>
|
|
18 <paramdef>long <parameter>offset</parameter></paramdef>
|
|
19 <paramdef>int <parameter>place</parameter></paramdef>
|
|
20 </funcprototype>
|
|
21
|
|
22 <funcprototype>
|
|
23 <funcdef><function>rewind</function></funcdef>
|
|
24 <paramdef>FILE *<parameter>fp</parameter></paramdef>
|
|
25 </funcprototype>
|
|
26
|
|
27 <funcprototype>
|
|
28 <funcdef>long <function>ftell</function></funcdef>
|
|
29 <paramdef>FILE *<parameter>fp</parameter></paramdef>
|
466
|
30 </funcprototype>
|
|
31 </funcsynopsis>
|
|
32
|
|
33 </refsynopsisdiv>
|
|
34
|
|
35 <refsect1><title>Description</title>
|
|
36 <para>
|
596
|
37 Fseek repositions the next character position of a file for
|
|
38 either read or write. The new position is a "offset" bytes
|
|
39 from the beginning of the file if "place" is 0, the current
|
|
40 position is 1, or the end if 2. Fseek sorts out the special
|
|
41 problems of buffering.
|
|
42 </para>
|
|
43 <para>
|
|
44 NOTE that using "lseek()" on a buffered file will produce
|
|
45 unpredictable results.
|
|
46 </para>
|
|
47 <para>
|
|
48 Rewind is equivalent to "fseek(fp,0L,0)".
|
|
49 </para>
|
|
50 <para>
|
|
51 Ftell returns the current position, measured in bytes, from the
|
|
52 beginning of the file pointed to by "fp".
|
466
|
53 </para>
|
|
54 </refsect1>
|
542
|
55
|
552
|
56 <refsect1><title>Diagnostics</title>
|
|
57 <para>
|
|
58 Fseek returns -1 if the call is invalid.
|
|
59 </para>
|
|
60 </refsect1>
|
|
61
|
542
|
62 <refsect1><title>See Also</title>
|
|
63 <para>
|
|
64 System call
|
|
65 <link linkend="lseek">lseek()</link>.
|
|
66 </para>
|
|
67 </refsect1>
|
|
68
|
466
|
69 </refentry>
|