Bug #52228 [Opn->Bgs]: fseek failure to seek
| From: | pajoye@php.net | Date: | Thu, 01 Jul 2010 20:04:05 +0000 |
| Subject: | Bug #52228 [Opn->Bgs]: fseek failure to seek | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-152018@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52228&edit=1
ID: 52228
Updated by: pajoye@php.net
Reported by: VJTD3 at VJTD3 dot com
Summary: fseek failure to seek
-Status: Open
+Status: Bogus
Type: Bug
Package: Filesystem function related
Operating System: *
PHP Version: Irrelevant
New Comment:
We already have feature requests for that.
Previous Comments:
------------------------------------------------------------------------
[2010-07-01 22:00:17] VJTD3 at VJTD3 dot com
Description:
------------
2147483647 or PHP_INT_MAX on the system is the max integer. fseek fails
with files over PHP_INT_MAX+2 in size. binary math would resolve the
fseek issue internally.
Test script:
---------------
reading a file of 20 gigabytes (or anything larger then PHP_INT_MAX+2)
is successful with:
<?php
$handle = fopen('20gbfile', 'r');
while (!feof($handle)) {
echo fread($handle, PHP_INT_MAX);
}
fclose($handle);
?>
however fseek fails:
<?php
$handle = fopen('20gbfile', 'r');
echo fread($handle, PHP_INT_MAX);
echo fread($handle, 2);
fseek($handle, -1, SEEK_CUR);
echo fread($handle, 1);
fclose($handle);
?>
Expected result:
----------------
echo the byte from position PHP_INT_MAX+1
Actual result:
--------------
crash/fail
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52228&edit=1