--- Jason Wong <[EMAIL PROTECTED]> wrote:
> On Tuesday 28 September 2004 03:54, Mark wrote:
>
> > With the echos above in place, I get the resource handle, and it
> > echos everything you would expect except that is_dir() fails to
> > recognize the directories.
>
> Because is_dir() expects a path to the file as well, otherwise it
> would be
> trying to look at $file in it's current working directory (cwd)
> wherever that
> may be (most likely not $maildir).
>
> > It DOES recognize . and .. as directories, for some bizarre
> reason.
>
> Because all directories contain '.' and '..' and hence the cwd of
> is_dir()
> would have those. (BTW '.' and '..' ARE directories).
Perhaps I should have been more precise (I'm sure I should have...)
When I echo $file, it echos what I would expect (the names of the
files and directories. I guess I need to prefix $file in the is_dir
statement with the full path to the file?
So like this?
$maildir=MERCURY."/MAIL";
$handle=opendir($maildir);
while ($file = readdir($handle)) {
if (is_dir("$maildir/$file") && ($file!=".") && ($file!="..")) {
$users[]=$file;
}
}
It seems contrary to what's in the help, but I'll try it out. Thanks!
Mark
=====
Mark Weinstock
[EMAIL PROTECTED]
***************************************
You can't demand something as a "right" unless you are willing to fight to death to
defend everyone else's right to the same thing.
***************************************
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php