Re: is_dir on WIndows
| From: | John Nichel | Date: | Mon, 27 Sep 2004 20:39:15 +0000 |
| Subject: | Re: is_dir on WIndows | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198009@lists.php.net to get a copy of this message | ||
Mark wrote:
--- John Nichel <john@kegworks.com> wrote:Are you giving is_dir() the full path from root to the directory? -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.comChris wrote:Which is the problem I'm having. It's not evaluating anything as a directory, except . and ..if (is_dir($file) && ($file!=".") && ($file!="..")) {since$users[]=$file;} It's only adding it to the array if all 3 of those are true. and$file can't be both '.' and '..' at the same time, it's nevermatching.I'd do something like: if (is_dir($file) || ($file!=".") || ($file!="..")) continue;That will match everything and anything, files and dot directories... The first statement by the OP should work fine. All three will eval to true if it is a directory, and the directory isn't . or ..