Re: Problem on OpenDir()
| From: | Brian McGarvie | Date: | Thu, 21 Nov 2002 12:14:30 +0000 |
| Subject: | Re: Problem on OpenDir() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125399@lists.php.net to get a copy of this message | ||
I don't do much file-stuff with php & windows, but i think the path nees to
use // not \\?
"Jack" <nedcor4@nedcor.com.hk> wrote in message
news:20021121115754.22148.qmail@pb1.pair.com...
Dear all
I was trying to check if a directory exist in a specific folder, but i got
this error message as below :
Warning: OpenDir: Invalid argument (errno 22) in C:\InetPub\wwwroot\Nedcor
Internal Live\Reports\Bills Reports\page.php on line 21
here is the code :
<?
$handle=opendir("c:\\");
$dirname=$filepath.$folder;
if (is_dir("Aegis"))
{
/* while (($file=readdir($handle))!==false)
{
if (ereg($premondate,$file))
{
copy($file, $filepath.$folder."/".$file);
}
closedir($handle);
}
*/
}
The strange thing is, the script had worked for once, but in the middle of
test stage, there is a permission error to the folder and after i fixed it,
it seems keep prompt me the Invalid Argument instead of open the folder.
Don't know what is going on! pls help!
Thx a lot,
Jack