PDA

View Full Version : Using the PHP 'dir' command?


Gaz
11-11-2000, 03:43 AM
I have attempted to use the following code to get a directory listing.

$d = dir("/big/dom/xmobiusware/mobius/www/{removethis}/orig/bullock/let/");
echo "Handle: ".$d->handle."
\n";
echo "Path: ".$d->path."
\n";
while($entry=$d->read()) {
[nbsp][nbsp][nbsp][nbsp]echo $entry."
\n";
}
$d->close();

However I get the error:
Warning: OpenDir: Permission denied (errno 13) in /big/dom/xmobiusware/{path}/movefile.php on line 21

I have chmod 777 the entire directory and the directory entry. What am I missing?

Thanks,

Gareth

Terra
11-11-2000, 06:02 PM
/big/dom/xmobiusware/mobius/www/{removethis}/orig/bullock/let/ You are trying to open the DIR through your HOME directory which is off limits to PHP...

I assume that I am supposed to remove '{removethis}' as well, otherwise if it's a real directory - then leave it...

Change it to:
/big/dom/xmobiusware/www/orig/bullock/let

--
Terra
--Some brick walls were not meant to be broken through--
FutureQuest

Gaz
11-11-2000, 06:17 PM
Thanks, that did the trick. I think I've tried at least 10 combinations - obviously not that one :-)

Thanks again for the speedy answer,

Gareth

PS sorry about the 'removethis', I tend to get paranoid at 3am in the morning :-)