Req #69213 [Opn->Nab]: consecutivly issued fseek don't work properly when together over PHP_MAX_INT
| From: | ab@php.net | Date: | Tue, 10 Mar 2015 14:40:20 +0000 |
| Subject: | Req #69213 [Opn->Nab]: consecutivly issued fseek don't work properly when together over PHP_MAX_INT | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-191288@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69213&edit=1
ID: 69213
Updated by: ab@php.net
Reported by: johnregphpbug at stefanie dot de
Summary: consecutivly issued fseek don't work properly when
together over PHP_MAX_INT
-Status: Open
+Status: Not a bug
Type: Feature/Change Request
Package: Filesystem function related
Operating System: Win 7 Home Premium SP1
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Thanks for the report.
PHP before 7 on Windows doesn't support large file operations. All the APIs used are 32 bit
APIs. Same for integers. Und anyway much less in the 32 bit build, no matter what bitness the OS
has.
Instead, it'd be really appreciable you to take some latest snapshot http://windows.php.net/downloads/snaps/master/
to test the functionality you've described. It is the highest time for that now :) Though note
that you'll need a 64 bit build for LFS.
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2015-03-10 13:57:01] johnregphpbug at stefanie dot de
Description:
------------
(This is my first ever bug report on php.)
(PHP 5.6.3 doesn't show up on the drop down list on the bug report form, so I choose
"irrelevant".)
I have Win 7, 64 bit. Latest XAMPP version, that has a 32 bit php 5.6.3.
On testing http://php.net/manual/en/function.fseek.php#112647
for a very big file (bigger than PHP_MAX_INT 2147483647) I'm now pretty sure, that the
consecutivly following fseeks are summed up before really executed on the filepointer.
The result is that those fseeks only seek up to PHP_MAX_INT ahead from the current
filepointer-position.
I found a workaround for that, as putting a fread between two originally consecutivly following
fseeks seems to stop the aggregation. (Though that workaround needs a second small workaround, as
fread can't be called with 0 bytes read length, so I have to fread one byte and put this in the
calculation for breaking up the big number seek to smaller seeks.)
(Another bug: Once the filepointer is over PHP_MAX_INT then ftell will give back a negative number.)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69213&edit=1