#32095 [Com]: file_exists() doesn't work with 2G+ files
| From: | steffen dot ryll at siemens dot com | Date: | Tue, 07 Mar 2006 16:04:00 +0000 |
| Subject: | #32095 [Com]: file_exists() doesn't work with 2G+ files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-94018@lists.php.net to get a copy of this message | ||
ID: 32095
Comment by: steffen dot ryll at siemens dot com
Reported By: david at giffin dot org
Status: No Feedback
Bug Type: Filesystem function related
Operating System: Linux Debian
PHP Version: 5.0.1
New Comment:
This bug report describes the effect mentioned by "hiro at arkusa dot
com" on http://www.php.net/manual/en/function.file-exists.php.
The Problem is, that file_exists($NameOfSomeLargeFile) returns false,
if $NameOfSomeLargeFile exists *but is larger than 2 GB*.
In my case, I have backup.tar.gz with size of 6.6 GB.
I expect file_exists("backup.tar.gz") to return true, but it returns
false.
System: Solaris 10 on SPARCv9, Apache/2.0.52 (Unix) DAV/2 PHP/5.0.5
I suspect php's limitation of int to 32 bits to be the cause, as
filesize("backup.tar.gz") gives me an error, too. (PHP Warning:
filesize(): stat failed for ...)
Previous Comments:
------------------------------------------------------------------------
[2005-03-20 18:09:58] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
------------------------------------------------------------------------
[2005-02-25 14:26:27] sniper@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2005-02-24 18:04:30] david at giffin dot org
Description:
------------
file_exists() doesn't work under apache with files that are >= 2 gig.
The script provided works using the cli version of php5 compilied on
the same system at the same time as the apache version.
Reproduce code:
---------------
<?php
print "<pre>";
$file = "/tmp/tester.file";
for ($i = 0; $i < 6; $i++) {
@unlink($file);
$cmd = "dd if=/dev/zero of=$file bs=1024 count=1024
seek={$i}M";
echo $cmd . "\n";
system($cmd);
system("ls -lh $file");
echo "File Exists: " . file_exists($file) . "\n";
print "\n";
}
@unlink($file);
print "</pre>";
?>
Expected result:
----------------
file_exists should return true even though the file is >= 2 gig
Actual result:
--------------
file_exists returns false if >= 2 gig
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32095&edit=1