Req #69213 [NEW]: consecutivly issued fseek don't work properly when together over PHP_MAX_INT

From: Date: Tue, 10 Mar 2015 13:57:03 +0000
Subject: Req #69213 [NEW]: consecutivly issued fseek don't work properly when together over PHP_MAX_INT
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191287@lists.php.net to get a copy of this message
From: johnregphpbug at stefanie dot de Operating system: Win 7 Home Premium SP1 PHP version: Irrelevant Package: Filesystem function related Bug Type: Feature/Change Request Bug description:consecutivly issued fseek don't work properly when together over PHP_MAX_INT 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 bug report at https://bugs.php.net/bug.php?id=69213&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69213&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69213&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69213&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69213&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69213&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69213&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69213&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69213&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69213&r=support Expected behavior: https://bugs.php.net/fix.php?id=69213&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69213&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69213&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69213&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69213&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69213&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69213&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69213&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69213&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69213&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69213&r=mysqlcfg

« previous php.bugs (#191287) next »