strangeness with is_dir()
| From: | hsmith at twilyt dot com | Date: | Wed, 24 Jan 2001 11:48:29 +0000 |
| Subject: | strangeness with is_dir() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-36399@lists.php.net to get a copy of this message | ||
Hi all
I'm trying to use is_dir to go thru a dir to list all dirs of that
I have a dir with 3 other dirs in them
[root@universe templates]# pwd
/www/docs/webit/admin/templates
[root@universe templates]# ls -l
total 12
drwxr-xr-x 4 root root 4096 Jan 12 13:16 1/
drwxr-xr-x 4 root root 4096 Jan 12 13:16 2/
drwxr-xr-x 2 root root 4096 Jan 12 13:16 CVS/
when I run this script section it only shows the CVS ..
<?
$handle=opendir('/www/docs/webit/admin/templates');
echo "Directory handle: $handle\n";
echo "Files:<br>";
while (($file = readdir($handle))!==false) {
if (is_dir($file)){
print "$file<BR>";
}
}
closedir($handle);
?>
can anybody help out why it doesn't see 1 and 2 as directories ?
Henti