[PHP] is_dir on WIndows

2004-09-27 Thread Mark
I'm having a problem I haven't encountered before. I'm using PHP 4.3.4 (upgrading the 4.3.9, but humor me) on Windows. I'm using the following code snippet to try to get all the subdirectories of a directory into an array. $maildir=MERCURY./MAIL; $handle=opendir($maildir); // echo $handle;

Re: [PHP] is_dir on WIndows

2004-09-27 Thread Chris
if (is_dir($file) ($file!=.) ($file!=..)) { $users[]=$file; } It's only adding it to the array if all 3 of those are true. and since $file can't be both '.' and '..' at the same time, it's never matching. I'd do something like: if (is_dir($file) || ($file!=.) || ($file!=..))

Re: [PHP] is_dir on WIndows

2004-09-27 Thread John Nichel
Chris wrote: if (is_dir($file) ($file!=.) ($file!=..)) { $users[]=$file; } It's only adding it to the array if all 3 of those are true. and since $file can't be both '.' and '..' at the same time, it's never matching. I'd do something like: if (is_dir($file) || ($file!=.) ||

Re: [PHP] is_dir on WIndows

2004-09-27 Thread Jason Wong
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

Re: [PHP] is_dir on WIndows

2004-09-27 Thread Mark
--- John Nichel [EMAIL PROTECTED] wrote: Chris wrote: if (is_dir($file) ($file!=.) ($file!=..)) { $users[]=$file; } It's only adding it to the array if all 3 of those are true. and since $file can't be both '.' and '..' at the same time, it's never matching.

Re: [PHP] is_dir on WIndows

2004-09-27 Thread Mark
--- 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

Re: [PHP] is_dir on WIndows

2004-09-27 Thread John Nichel
Mark wrote: --- John Nichel [EMAIL PROTECTED] wrote: Chris wrote: if (is_dir($file) ($file!=.) ($file!=..)) { $users[]=$file; } It's only adding it to the array if all 3 of those are true. and since $file can't be both '.' and '..' at the same time, it's never matching. I'd do

Re: [PHP] is_dir on WIndows

2004-09-27 Thread Mark
--- 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

Re: [PHP] is_dir on WIndows

2004-09-27 Thread Curt Zirzow
* Thus wrote Mark: I'm having a problem I haven't encountered before. I'm using PHP 4.3.4 (upgrading the 4.3.9, but humor me) on Windows. I'm using the following code snippet to try to get all the subdirectories of a directory into an array. $maildir=MERCURY./MAIL;

Re: [PHP] is_dir on WIndows

2004-09-27 Thread Chris
John Nichel wrote: Chris wrote: 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 ..