#42027 [NEW]: is_file()/is_dir() do not match file/dirnames with wildcard char&trailing slash

From: Date: Wed, 18 Jul 2007 11:38:10 +0000
Subject: #42027 [NEW]: is_file()/is_dir() do not match file/dirnames with wildcard char&trailing slash
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115173@lists.php.net to get a copy of this message
From: mahesh dot vemula at in dot ibm dot com Operating system: RHEL 4 PHP version: 5.2.3 PHP Bug Type: Scripting Engine problem Bug description: is_file()/is_dir() do not match file/dirnames with wildcard char&trailing slash Description: ------------ is_file() matches for a file name given with wild-card character/trailing slash on Windows, but not on Linux. When wild-card char/trailing slash is given in the file name as input to the function, the function returns false on Linux. In the same manner, is_dir() matches for a dir name given with wild-card character on Windows, but not on Linux. When wild-card is given in the dir name as input to the function, the function returns false on Linux. A consistent behavior of the function is expected. Environment: Operating System: RHEL 4 PHP Version: PHP 5.2 Configure Setup: ./configure Reproduce code: --------------- <?php fclose( fopen("test.tmp", "w") ); var_dump( is_file("test.tmp") ); var_dump( is_file("test.tmp/") ); var_dump( is_file("*.tmp") ); unlink("test.tmp"); mkdir("temp"); var_dump( is_dir("temp") ); var_dump( is_dir("temp/") ); var_dump( is_dir("*mp") ); rmdir("temp"); ?> Expected result: ---------------- bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) Actual result: -------------- bool(true) bool(false) bool(false) bool(true) bool(true) bool(false) -- Edit bug report at http://bugs.php.net/?id=42027&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42027&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42027&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42027&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42027&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42027&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42027&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42027&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42027&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42027&r=support Expected behavior: http://bugs.php.net/fix.php?id=42027&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42027&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42027&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42027&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42027&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42027&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42027&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42027&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42027&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42027&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42027&r=mysqlcfg

« previous php.bugs (#115173) next »