#47371 [Opn->Csd]: fseek: Description of negative offset use is not clear
| From: | torben@php.net | Date: | Fri, 04 Sep 2009 07:29:19 +0000 |
| Subject: | #47371 [Opn->Csd]: fseek: Description of negative offset use is not clear | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-2723@lists.php.net to get a copy of this message | ||
ID: 47371
Updated by: torben@php.net
Reported By: sammywg@php.net
-Status: Open
+Status: Closed
Bug Type: Documentation problem
PHP Version: Irrelevant
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2009-09-04 07:28:54] svn@php.net
Automatic comment from SVN on behalf of torben
Revision: http://svn.php.net/viewvc/?view=revision&revision=288029
Log: Note that in order to use a negative offset to count from the end
of
the file, you must specify SEEK_END in the 'whence' parameter.
Addresses bug #47371.
------------------------------------------------------------------------
[2009-02-12 16:27:46] sammywg@php.net
Description:
------------
If you want to use negative fseek offset, it is not enough to use a
negative offset as second parameter, also the third parameter must be
specified as SEEK_END. The documentation should note that fact,
currently it appears as if a function call like
$i = fseek($filehandle, -100);
would be adequate.
Reproduce code:
---------------
http://php.net/fseek
Expected result:
----------------
To move to a position before the end-of-file, you need to pass a
negative value in offset and set the whence parameter to SEEK_END.
Actual result:
--------------
To move to a position before the end-of-file, you need to pass a
negative value in offset .
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47371&edit=1