note 26780 deleted from function.opendir by sniper
| From: | sniper@php.net | Date: | Sun, 12 Oct 2003 04:25:00 +0000 |
| Subject: | note 26780 deleted from function.opendir by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58325@lists.php.net to get a copy of this message | ||
Note Submitter: felixjakob@fragattack.de
----
I had Problems with is_dir() and opendir() because it behaves a little bit goofy. Some directorys
were found and some were normal files. I wrote a script to manage a normal filesystem without the
goofy behavior:
<?
chdir($folder);
$folder = getcwd();
echo "<br>$folder<br>";
function folder($data_folder) {
$handle=@opendir($data_folder);
echo "<blockquote>";
while (@$file = readdir ($handle)) {
if (is_dir($file)) {
echo "<a href=index.php3?id=253&folder=";
echo htmlentities(urlencode($data_folder));
echo "\\\\";
echo htmlentities(urlencode($file));
echo "><font size=2 color=blue
face=Tahoma>$file</font></a><br>";
} else {
echo "<font size=2 face=Tahoma>$file</font><br>";
}
}
echo "</blockquote>";
}
folder($folder);
?>