ID: 39063
User updated by: nherdananto at gmail dot com
Reported By: nherdananto at gmail dot com
-Status: Feedback
+Status: Open
Bug Type: Filesystem function related
Operating System: FreeBSD 5.5
PHP Version: 4.4.4
New Comment:

im running apache 2.0.59
and yes, threaded, limited to 256 thread.


Previous Comments:
------------------------------------------------------------------------

[2006-10-06 14:40:19] [email]tony2001php.net[/email]

What kind of server API are you using and is it threaded or not?

------------------------------------------------------------------------

[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 [url]http://bugs.php.net/?id=39063&edit=1[/url]