#39063 [Fbk->Opn]: is_file() and file_exists() returning false on high load

From: Date: Fri, 06 Oct 2006 14:58:45 +0000
Subject: #39063 [Fbk->Opn]: is_file() and file_exists() returning false on high load
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-103200@lists.php.net to get a copy of this message
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] tony2001@php.net 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 http://bugs.php.net/?id=39063&edit=1

« previous php.bugs (#103200) next »