#34750 [NEW]: filesize()/stat() fails on too big files
| From: | aulbach at mayflower dot de | Date: | Thu, 06 Oct 2005 08:08:20 +0000 |
| Subject: | #34750 [NEW]: filesize()/stat() fails on too big files | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-86077@lists.php.net to get a copy of this message | ||
From: aulbach at mayflower dot de
Operating system: all
PHP version: 4.4.0
PHP Bug Type: *Directory/Filesystem functions
Bug description: filesize()/stat() fails on too big files
Description:
------------
Writing a php command-line script, which scans all my files on my big
raid, I mentioned, that PHP is not able to handle the case, when the files
are bigger than 4 GB. But this is more and more used, cause for example
complete DVD-images are just put in one file.
PHP itself cannot handle bigger numbers, cause it uses 32 bit integer.
Currently I help me with
ls but that's no real solution.
Everyone is using 64 bit integer now. There are many cases, timestamps for
example.
For now I suggest, that the number is stored as a string, if it gets too
big. I use that number only to write it into the database (which can
handle 64 bit int), so for that case this is correct.
For long term, I suggest a mechanism, that automatically assigns 64 bit
integer, if the number gets too big.
Reproduce code:
---------------
$fsize = filesize($path); // returns invalid if file is too big, the rest
of the program will fail, if I assume, that there will be a number
OR
$stats = stat($path); // complete record invalid
--
Edit bug report at http://bugs.php.net/?id=34750&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34750&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34750&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34750&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34750&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34750&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34750&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34750&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34750&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34750&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34750&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=34750&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=34750&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34750&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34750&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34750&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34750&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34750&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34750&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34750&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34750&r=mysqlcfg