Bug #10898 Updated: is_dir && filetype return wrong values
| From: | yves at monet dot be | Date: | Thu, 17 May 2001 07:13:07 +0000 |
| Subject: | Bug #10898 Updated: is_dir && filetype return wrong values | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-55583@lists.php.net to get a copy of this message | ||
ID: 10898
User Update by: yves@monet.be
Status: Bogus
Bug Type: Filesystem function related
Operating system: Win ME & Win NT 4.0
PHP Version: 4.0.5
Description: is_dir && filetype return wrong values
Hello,
than the docs in my book are wrong, it says file instead of path. Sorry for wasting your time...
Previous Comments:
---------------------------------------------------------------------------
[2001-05-16 10:53:13] cynic@php.net
this is bogus. you have to either chdir() into the $parent or is_dir() the full path.
---------------------------------------------------------------------------
[2001-05-16 08:35:02] yves@monet.be
A little script that should echo alle filetypes of all files in any subdir of the parent provided.
Now I use opendir to test wether the file is a dir, but this isn't a good solution, is it?
The is_dir() allways returns false
the filetype() allwyas returns dir
<?php
function getFileInfo($parent)
{
$handle = opendir($parent);
while ($file = readdir($handle))
{
$filelist[]=$file ;
}
reset($filelist);
while(list(,$f)=each ($filelist))
{
if ($f!="." && $f!="..")
{
if(is_dir($f))
{
getFileInfo($f);
}
else
{
echo filetype($f);
}
}
}
}
getFileInfo("c:datapdf");
?>
---------------------------------------------------------------------------
[2001-05-16 06:23:07] derick@php.net
Please provide a short script so that we can reproduce it.
Derick
---------------------------------------------------------------------------
[2001-05-16 05:44:07] yves@monet.be
Hello,
I'm running php 4.0.5 on my win ME & Win NT 4.0 and I have experienced 2 functions
returning the wrong values. I don't know if this bug is allready reported.
the is_dir() allways returns false except for "." && ".."
the filetype() allways returns dir
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=10898