reference/filesystem/functions/fseek.xml
cc735f9ff7aaa32e5ed2eae501f9942c0d05493c
cc735f9ff7aaa32e5ed2eae501f9942c0d05493c
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.fseek">
3
+
<refentry xml:id="function.fseek" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>fseek</refname>
6
6
<refpurpose>Seeks on a file pointer</refpurpose>
...
...
@@ -10,13 +10,13 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>int</type><methodname>fseek</methodname>
13
-
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
13
+
<methodparam><type>resource</type><parameter>stream</parameter></methodparam>
14
14
<methodparam><type>int</type><parameter>offset</parameter></methodparam>
15
-
<methodparam choice="opt"><type>int</type><parameter>whence</parameter><initializer>SEEK_SET</initializer></methodparam>
15
+
<methodparam choice="opt"><type>int</type><parameter>whence</parameter><initializer><constant>SEEK_SET</constant></initializer></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
18
Sets the file position indicator for the file referenced by
19
-
<parameter>handle</parameter>. The new position, measured in bytes
19
+
<parameter>stream</parameter>. The new position, measured in bytes
20
20
from the beginning of the file, is obtained by adding
21
21
<parameter>offset</parameter> to the position specified by
22
22
<parameter>whence</parameter>.
...
...
@@ -35,7 +35,7 @@
35
35
<para>
36
36
<variablelist>
37
37
<varlistentry>
38
-
<term><parameter>handle</parameter></term>
38
+
<term><parameter>stream</parameter></term>
39
39
<listitem>
40
40
&fs.file.pointer;
41
41
</listitem>
...
...
@@ -47,9 +47,9 @@
47
47
The offset.
48
48
</para>
49
49
<para>
50
-
To move to a position before the end-of-file, you need to pass
51
-
a negative value in <parameter>offset</parameter> and
52
-
set <parameter>whence</parameter>
50
+
To move to a position before the end-of-file,
51
+
a negative value in the <parameter>offset</parameter> must be passed and
52
+
the <parameter>whence</parameter> parameter must be set
53
53
to <constant>SEEK_END</constant>.
54
54
</para>
55
55
</listitem>
...
...
@@ -60,9 +60,9 @@
60
60
<para>
61
61
<parameter>whence</parameter> values are:
62
62
<simplelist>
63
-
<member><constant>SEEK_SET</constant> - Set position equal to <parameter>offset</parameter> bytes.</member>
64
-
<member><constant>SEEK_CUR</constant> - Set position to current location plus <parameter>offset</parameter>.</member>
65
-
<member><constant>SEEK_END</constant> - Set position to end-of-file plus <parameter>offset</parameter>.</member>
63
+
<member><constant>SEEK_SET</constant> - Set position equal to <parameter>offset</parameter> bytes from the start of the file.</member>
64
+
<member><constant>SEEK_CUR</constant> - Set position to current location plus <parameter>offset</parameter> bytes.</member>
65
+
<member><constant>SEEK_END</constant> - Set position to end-of-file plus <parameter>offset</parameter> bytes.</member>
66
66
</simplelist>
67
67
</para>
68
68
</listitem>
...
...
@@ -74,8 +74,16 @@
74
74
<refsect1 role="returnvalues">
75
75
&reftitle.returnvalues;
76
76
<para>
77
-
Upon success, returns 0; otherwise, returns -1.
77
+
Upon success, returns <literal>0</literal>;
78
+
otherwise, returns <literal>-1</literal>.
78
79
</para>
80
+
<warning>
81
+
<simpara>
82
+
This function was created to imitate the C language function of the same
83
+
name. Please pay attention to the return values as they differ from what
84
+
one would expect in PHP.
85
+
</simpara>
86
+
</warning>
79
87
</refsect1>
80
88
81
89
<refsect1 role="examples">
...
...
@@ -133,7 +141,6 @@ fseek($fp, 0);
133
141
</refsect1>
134
142
135
143
</refentry>
136
-
137
144
<!-- Keep this comment at the end of the file
138
145
Local variables:
139
146
mode: sgml
140
147