#47025 [NEW]: DirectoryIterator::getSize always returns a value under 4GB
| From: | bfanger at gmail dot com | Date: | Wed, 07 Jan 2009 11:35:24 +0000 |
| Subject: | #47025 [NEW]: DirectoryIterator::getSize always returns a value under 4GB | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-132615@lists.php.net to get a copy of this message | ||
From: bfanger at gmail dot com
Operating system: Mac OS X 10.5.6
PHP version: 5.2.8
PHP Bug Type: Filesystem function related
Bug description: DirectoryIterator::getSize always returns a value under 4GB
Description:
------------
I tried to create a directory listing including the filesize.
But the directory containing a 4.4GB file shows an incorrect filesize of
400MB
DirectoryIterator::getSize and filesize() have the same (32bit signed int)
problem.
Possible solutions:
1. Use a string (or other datatype) that can contain the filesize. (Bug
#44215)
2. An extra optional parameter: filesize(string $filename, [bool
human_readable = false])
Reproduce code:
---------------
Using (not-existing) solution 2
$file = "/path/to/4.4GiB.file";
echo filesize($file, true);
Expected result:
----------------
4.4G
Actual result:
--------------
401524051
--
Edit bug report at http://bugs.php.net/?id=47025&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47025&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47025&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47025&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=47025&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47025&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=47025&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=47025&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=47025&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=47025&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=47025&r=support
Expected behavior: http://bugs.php.net/fix.php?id=47025&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=47025&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=47025&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=47025&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47025&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47025&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=47025&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=47025&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=47025&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=47025&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=47025&r=mysqlcfg