From: cherub at dagservice dot nl
Operating system: Windows XP SP2
PHP version: 5.0.1
PHP Bug Type: Filesystem function related
Bug description: existing files not seen (not existant)
Description:
------------
I used the script below to generate a filename, and check if it already
exists useing file_exists (block 1). It generates the following output:
"File 'C:\Program Files\Apache
Group\Apache2\htdocs\aanleverwizard/temppics/e88d28551c277889a0b34b4b2135d348/pic0.png'
does not exist!". However, when I copy/paste this to the windows run
dialog, it actually is executed, so the file does exist!
I also tried replacing the file_exists function with a replacement
function (block 2), but that also doesn't work...
Reproduce code:
---------------
//BLOCK 1: REPRODUCE FILE_EXISTS BUG
$Teller = 0;
$TestFile = getcwd(). '/temppics/'. session_id(). '/pic'. $Teller.
'.png';
if (file_exists($TestFile)){
echo('File \''. $TestFile. '\' exists!<BR>');
} else {
echo('File \''. $TestFile. '\' does not exist!<BR>');
}
// BLOCK2: ALTERNATIVE TO FILE_EXISTS FUNCTION
if (!function_exists('file_does_exist')){
function file_does_exist($FileName){
if (glob($FileName)){
return true;
} else return false;
}
}
Expected result:
----------------
I expect file_exists to return true, but it does not. I did verify that
the file does actually exist.
Actual result:
--------------
// see description.
--
Edit bug report at http://bugs.php.net/?id=30564&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30564&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30564&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30564&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30564&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30564&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30564&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30564&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30564&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30564&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30564&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30564&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30564&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30564&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30564&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30564&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30564&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30564&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30564&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30564&r=mysqlcfg