#19658 [NEW]: is_dir or is_file doesn't work in all cases
| From: | dirks dot plaza at hccnet dot nl | Date: | Sun, 29 Sep 2002 13:22:20 +0000 |
| Subject: | #19658 [NEW]: is_dir or is_file doesn't work in all cases | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-20659@lists.php.net to get a copy of this message | ||
From: dirks.plaza@hccnet.nl
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