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

From: Date: Wed, 18 Jul 2007 15:37:02 +0000
Subject: #42027 [Opn]: is_file()/is_dir() do not match file/dirnames with wildcard char&trailing slash
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115196@lists.php.net to get a copy of this message
ID: 42027 Updated by: jani@php.net Reported By: mahesh dot vemula at in dot ibm dot com Status: Open Bug Type: Scripting Engine problem Operating System: RHEL 4 PHP Version: 5.2.3 New Comment: Obviously Windows side is doing it wrong. I expect wildcards in filenames passed to is_file to return false. Previous Comments: ------------------------------------------------------------------------ [2007-07-18 11:38:10] mahesh dot vemula at in dot ibm dot com 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 this bug report at http://bugs.php.net/?id=42027&edit=1

« previous php.bugs (#115196) next »