Req #54902 [Opn]: fseek inconsistencies with large (>2GB) files
Edit report at http://bugs.php.net/bug.php?id=54902&edit=1
ID: 54902
User updated by: zingaburga at hotmail dot com
Reported by: zingaburga at hotmail dot com
Summary: fseek inconsistencies with large (>2GB) files
Status: Open
Type: Feature/Change Request
Package: Filesystem function related
Operating System: Windows 7
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
If you're wondering, I'm using the following function to try to get
around the fseek limitations. It works, but it's really slow for large
seeks. If the 8KB limitation could be lifted, then this function could
be serveral times faster.
http://pastebin.com/xWiQxgSB
Previous Comments:
------------------------------------------------------------------------
[2011-05-22 05:24:38] zingaburga at hotmail dot com
Description:
------------
Firstly, I'm aware that fseek/ftell doesn't necessarily work correctly
with >2GB files with 32-bit PHP due to integer range constraints,
however, fseek operates rather inconsistently when passing 2GB, which
would be nice if fixed (note that I've put this as a feature request, as
it's a nice to have, and unsure if you'd classify this as a bug).
I'm using the 32-bit Windows build from here:
http://windows.php.net/download/
See example script [ http://pastebin.com/Zb0vRgWX ] with
comments for
more info.
I haven't looked at PHP's source code, but from the behaviour of the
script, I'm guessing that fseek does some checks, and because it's
overflowing, it won't allow certain operations. I'm not sure about the
weird 8192 byte limit though.
As fread allows overflows, would it be possible to allow fseek to
overflow too?
(PS first time I've submitted a "bug" - I hope I've done it correctly
>_>)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54902&edit=1
Thread (5 messages)