#47025 [Opn->Bgs]: DirectoryIterator::getSize always returns a value under 4GB

From: Date: Thu, 08 Jan 2009 00:42:04 +0000
Subject: #47025 [Opn->Bgs]: DirectoryIterator::getSize always returns a value under 4GB
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-132649@lists.php.net to get a copy of this message
ID: 47025 Updated by: felipe@php.net Reported By: bfanger at gmail dot com -Status: Open +Status: Bogus Bug Type: Filesystem function related Operating System: Mac OS X 10.5.6 PHP Version: 5.2.8 New Comment: It's expected, PHP doesnt works with large files yet. This is an item in our TODO, thanks. Previous Comments: ------------------------------------------------------------------------ [2009-01-07 11:35:23] bfanger at gmail dot com 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 this bug report at http://bugs.php.net/?id=47025&edit=1

« previous php.bugs (#132649) next »