Re: [PHP] Strange is_dir() behavior

2005-07-01 Thread Marcos Mendonça
Well, i´ll check it out, but i think i don´t have that code anymore.
Since it wasn´t working i did the same using opendir instead of dir.

Thanx anyway.

On 6/30/05, Richard Lynch [EMAIL PROTECTED] wrote:
 On Sat, June 25, 2005 8:54 am, Marcos Mendonça said:
  Yes, if i try to to echo the variable $entry outside the if is returns
  the expected directories list.
 
  I tried giving it the full path and it still doesn't work.
 
 Show us that source code.
 
 Cuz I wouldn't expect it to work without the full path for is_dir()
 
 But if it's not working with the full path...
 
 You've done something wrong.
 
 Okay, maybe you've found a bug in PHP that 1,238,874,988 other users have
 missed...
 
 --
 Like Music?
 http://l-i-e.com/artists.htm
 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Strange is_dir() behavior

2005-06-30 Thread Richard Lynch
On Sat, June 25, 2005 8:54 am, Marcos Mendonça said:
 Yes, if i try to to echo the variable $entry outside the if is returns
 the expected directories list.

 I tried giving it the full path and it still doesn't work.

Show us that source code.

Cuz I wouldn't expect it to work without the full path for is_dir()

But if it's not working with the full path...

You've done something wrong.

Okay, maybe you've found a bug in PHP that 1,238,874,988 other users have
missed...

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Strange is_dir() behavior

2005-06-25 Thread Marcos Mendonça
Hello

I'm using PHP 4.3.9, under Windows XP with Apache.

I have the following directory structure on a given app, i'm working on.

photos/
   folder1
   folder2
   folder3
   ... and so on

I'm trying the following code to make a list of folder under photos:

  $d = dir('photos/');

while (false !== ($entry = $d-read())) {
if (is_dir($entry)  $entry != '.'  $entry != 
'..')
echo $entry . br /;
}

For some strange reason, that echoes nothing. is_dir is returning
false on every folder (dir)
under photos, except for '.' and '..' dirs. Can someone explain this?

Thanks ind advance.
Marcos

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Strange is_dir() behavior

2005-06-25 Thread Burhan Khalid

Marcos Mendonça wrote:

Hello

I'm using PHP 4.3.9, under Windows XP with Apache.

I have the following directory structure on a given app, i'm working on.

photos/
   folder1
   folder2
   folder3
   ... and so on

I'm trying the following code to make a list of folder under photos:

  $d = dir('photos/');

while (false !== ($entry = $d-read())) {
if (is_dir($entry)  $entry != '.'  $entry != 
'..')
echo $entry . br /;
}

For some strange reason, that echoes nothing. is_dir is returning
false on every folder (dir)
under photos, except for '.' and '..' dirs. Can someone explain this?


iirc, is_dir is relative to the path of the script that is calling it. 
Try giving it the full path of the directory. Might solve your problem.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Strange is_dir() behavior

2005-06-25 Thread Edward Vermillion


On Jun 25, 2005, at 8:34 AM, Marcos Mendonça wrote:


Hello

I'm using PHP 4.3.9, under Windows XP with Apache.

I have the following directory structure on a given app, i'm working 
on.


photos/

folder1
folder2
folder3
... and so on


I'm trying the following code to make a list of folder under photos:

  $d = dir('photos/');

while (false !== ($entry = $d-read())) {
if (is_dir($entry)  $entry != '.'  $entry != 
'..')
echo $entry . br /;
}

For some strange reason, that echoes nothing. is_dir is returning
false on every folder (dir)
under photos, except for '.' and '..' dirs. Can someone explain this?


What do you get if you just echo out $entry without the if() statement?

Do you get a list of the directories you'd expect?



Edward Vermillion
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Strange is_dir() behavior

2005-06-25 Thread Marcos Mendonça
Yes, if i try to to echo the variable $entry outside the if is returns
the expected directories list.

I tried giving it the full path and it still doesn't work.

On 6/25/05, Edward Vermillion [EMAIL PROTECTED] wrote:
 
 On Jun 25, 2005, at 8:34 AM, Marcos Mendonça wrote:
 
  Hello
 
  I'm using PHP 4.3.9, under Windows XP with Apache.
 
  I have the following directory structure on a given app, i'm working
  on.
 
  photos/
  folder1
  folder2
  folder3
  ... and so on
 
  I'm trying the following code to make a list of folder under photos:
 
$d = dir('photos/');
 
while (false !== ($entry = $d-read())) {
if (is_dir($entry)  $entry != '.'  $entry != 
  '..')
echo $entry . br /;
}
 
  For some strange reason, that echoes nothing. is_dir is returning
  false on every folder (dir)
  under photos, except for '.' and '..' dirs. Can someone explain this?
 
 What do you get if you just echo out $entry without the if() statement?
 
 Do you get a list of the directories you'd expect?
 
 
 
 Edward Vermillion
 [EMAIL PROTECTED]
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Strange is_dir() behavior

2005-06-25 Thread Marek Kilimajer

Marcos Mendonça wrote:

Hello

I'm using PHP 4.3.9, under Windows XP with Apache.

I have the following directory structure on a given app, i'm working on.

photos/
   folder1
   folder2
   folder3
   ... and so on

I'm trying the following code to make a list of folder under photos:

  $d = dir('photos/');

while (false !== ($entry = $d-read())) {
if (is_dir($entry)  $entry != '.'  $entry != 
'..')
echo $entry . br /;
}

For some strange reason, that echoes nothing. is_dir is returning
false on every folder (dir)
under photos, except for '.' and '..' dirs. Can someone explain this?


is_dir() is checking for 'folder1', 'folder2' etc. You want it to check 
 'photos/folder1', 'photos/folder2'


Use:
if (is_dir('photos/' . $entry) 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php