mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
- Behavior when seeking past the end of file.
Partially addresses bug #52335. - Expanded note on how the stream may not support seeking. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@305317 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
9adf7eba60
commit
6616df4f3e
1 changed files with 11 additions and 5 deletions
|
@ -21,6 +21,13 @@
|
|||
<parameter>offset</parameter> to the position specified by
|
||||
<parameter>whence</parameter>.
|
||||
</para>
|
||||
<para>
|
||||
In general, it is allowed to seek past the end-of-file; if data is then
|
||||
written, reads in any unwritten region between the end-of-file and the
|
||||
sought position will yield bytes with value 0. However, certain streams
|
||||
may not support this behavior, especially when they have an underlying
|
||||
fixed size storage.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -67,8 +74,7 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Upon success, returns 0; otherwise, returns -1. Note that seeking
|
||||
past EOF is not considered an error.
|
||||
Upon success, returns 0; otherwise, returns -1.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -109,9 +115,9 @@ fseek($fp, 0);
|
|||
</note>
|
||||
<note>
|
||||
<para>
|
||||
May not be used on file pointers returned by <function>fopen</function> if
|
||||
they use the <literal>http://</literal> or <literal>ftp://</literal>
|
||||
schemes.
|
||||
Not all streams support seeking. For those that do not support seeking,
|
||||
forward seeking from the current position is accomplished by reading
|
||||
and discarding data; other forms of seeking will fail.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
|
Loading…
Reference in a new issue