I'm developing on Windows, and I have a bit of code that is designed to do a
quick recursive read on a folder. An integral part of this is the use of
the is_dir() function to decide if it should recurse or not.
DoIt('G:\\');
function DoIt($path){
$handle=opendir("$path");
echo "Directory handle: $handle\n<br>";
echo "Files:\n";
while (($file = readdir($handle))) {
if (is_dir($file) and $file != '.'){ #otherwise the '.' will send it
into
a loop
print "<dir>";
DoIt($file);
print "</dir>";
} else {
print "<li>".$file;
}
}
closedir($handle);
}
The problem I have is rather odd. It seems to work on one machine (a
Windows NT 4 box) but on two others (one windows 98 and one NT4) the
if_dir() function returns false for everything except the . directory.
Does anyone know why this would be?
thanks.
Michael Hall
Database Engineer
Prairie Fire Web Design
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]