#39063 [Opn->Fbk]: is_file() and file_exists() returning false on high load
| From: | tony2001@php.net | Date: | Fri, 06 Oct 2006 14:40:19 +0000 |
| Subject: | #39063 [Opn->Fbk]: is_file() and file_exists() returning false on high load | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-103198@lists.php.net to get a copy of this message | ||
ID: 39063
Updated by: tony2001@php.net
Reported By: nherdananto at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: FreeBSD 5.5
PHP Version: 4.4.4
New Comment:
What kind of server API are you using and is it threaded or not?
Previous Comments:
------------------------------------------------------------------------
[2006-10-06 14:20:36] nherdananto at gmail dot com
sorry, wrong code. here's the code
$tid = isset( $_GET['tid'] ) ? $_GET['tid'] : "";
$file = "/data/".$tid.".txt";
if(file_exists($file)) {
echo "1";
} else {
echo "0";
}
------------------------------------------------------------------------
[2006-10-06 14:18:50] nherdananto at gmail dot com
Description:
------------
is_file() or file_exists() returning false on existing file.
the script is executed about 8x per second and checking a file in a
directory filled with 5000 to 30000 files.
for 344000 execution, it fails about 2000 times.
no change on php.ini
Reproduce code:
---------------
$tid = isset( $_GET['tid'] ) ? $_GET['tid'] : "";
$file = "/data/".$tid.".txt";
if(file_exists()) {
echo "1";
} else {
echo "0";
}
Expected result:
----------------
for 344000 execution, it should producing 1 for 344000 times.
Actual result:
--------------
less than 344000 times of 1 echoed.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39063&edit=1