dir object on windows (inconsistancy)
| From: | Mark A Mucha | Date: | Thu, 06 Jul 2000 06:59:49 +0000 |
| Subject: | dir object on windows (inconsistancy) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-5176@lists.php.net to get a copy of this message | ||
Hi
I am having trouble with the dir object on windows. It hasn't been
consistant.
*************************
<?
if(! $dir = opendir($fileDir)){
echo "Error\n<br>";
}else{
while($file = readdir($dir)){
printf("<li><a
href=\"http://crocbyte/check_file.php?url=%s/%s\">%s</a>\n",
"http://crocbyte/jim/pics/LAT", $file,
$file);
}
}
?>
</ol>
fileDir=<? echo $fileDir ?><br>
*************************
This at times only prints the fileDir=c:\\InetPub\\wwwroot\\jim\\pics\\1240
I run it a couple of times and it prints out the contents again. If I try
to change directories i get an
error Warning: OpenDir: Invalid argument (errno 22) in
c:\inetpub\wwwroot\file_test.php on line 6
Error
fileDir=c:\\InetPub\\wwwroot\\jim\\pics\\196
Why is this not being a good little PHP script???
Thanks
Mark