Edit report at https://bugs.php.net/bug.php?id=27792&edit=1
ID: 27792
Comment by: adu at rdsor dot ro
Reported by: kode at kodekrash dot com
Summary: [PATCH] Functions fail on large files
(filesize,is_file,is_dir,readdir)
Status: Critical
Type: Bug
Package: Filesystem function related
Operating System: * (LFS)
PHP Version: 5.*, 6CVS (2009-04-30)
Block user comment: N
Private report: N
New Comment:
@marcb
I tested it in "PHP 5.4.0 (cli) (built: Apr 12 2012 13:02:59)) on Ubuntu 12.04
kernel 3.0.0-19 i686" and the BUG is still here.
Reproduced code:
$fname = 'file_of_7GB';
var_dump(filesize( $fname ));
// PHP Warning: filesize(): stat failed for file_of_7GB in php_bug_27792.php
on line 4
// dumps bool(false)
var_dump(is_file( $fname ));
// dumps bool(false)
var_dump(is_dir( $fname ));
// dumps bool(false)
$fname = 'file_of_354MB';
var_dump(filesize( $fname ));
// dumps int(370336155)
var_dump(is_file( $fname ));
// dumps bool(true)
var_dump(is_dir( $fname ));
// dumps bool(false)
Previous Comments:
------------------------------------------------------------------------
[2011-01-05 04:46:23] marcb at voicemeup dot com
Is anyone able to confirm if this was fixed in any of the 5.X branch ?
This is a pretty stupid problem to have to deal with !
------------------------------------------------------------------------
[2009-11-12 10:27:45] boite dot pour dot spam at gmail dot com
The patch from Wez doesn't work, as it assumes size_t are 64 bits, which is not
the case, even when LFS is defined.
The patch from Mail Pourri works on 5.3.0 (I haven't tested in 5.3.1)
------------------------------------------------------------------------
[2009-09-14 08:59:36] [email protected]
The latest patch for this:
http://www.php.net/~wez/lfs.diff
------------------------------------------------------------------------
[2009-07-11 13:40:57] mail dot pourri at laposte dot net
Please see fix in http://bugs.php.net/bug.php?id=48886
------------------------------------------------------------------------
[2009-04-30 19:45:57] [email protected]
And bug #45040
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=27792
--
Edit this bug report at https://bugs.php.net/bug.php?id=27792&edit=1