From: [EMAIL PROTECTED] Operating system: Windows 2000 PHP version: 4.2.0 PHP Bug Type: Directory function related Bug description: is_dir or is_file doesn't work in all cases
This script works OK: if ($handle = @opendir('.')) { while (false !== ($file = readdir($handle))) { if (is_dir($file)) { echo "Is directory $file <BR>"; } else Print "Is file $file <BR>"; } closedir($handle); } When I replace "." with i.e. "C:\webpages\test" (this is the directory where I run the script from) it also works fine. But when I try the read a directory which is not in the same directory as the script i.e. "C:\webpages" than it displays that there are only files. So reading a directory lower or higher that the direcory where you are running a script from gives a wrong output. -- Edit bug report at http://bugs.php.net/?id=19658&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=19658&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=19658&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=19658&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=19658&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=19658&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=19658&r=support Expected behavior: http://bugs.php.net/fix.php?id=19658&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=19658&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=19658&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=19658&r=globals