God damn directory problems!!
Posted: Tue Jan 14, 2003 1:40 pm
I'm using the following script to view folders and files on my server.
It works because it's showing all the folders and files.. which is good.
The problem is that the is_file() and is_dir() calls aren't doing their job properly. Some times they work, some times they don't!
I've tried a range of CHMOD values on the files and folders but they seem to have no effect.
If you can help... HELP!
It works because it's showing all the folders and files.. which is good.
The problem is that the is_file() and is_dir() calls aren't doing their job properly. Some times they work, some times they don't!
I've tried a range of CHMOD values on the files and folders but they seem to have no effect.
If you can help... HELP!
Code: Select all
<?php
if ($dir=opendir($path))
{
while (($file = readdir($dir)) !== false)
{
if(is_dir($file)==true) { echo($file." [folder]<br>\n"); }
elseif(is_file($file)==true) { echo($file." [file]<br>\n"); }
else { echo ($file." [don't have a clue!]<br>\n"); }
}
closedir($dir);
}
?>