#31377 [Opn->Fbk]: is_dir function
| From: | sniper@php.net | Date: | Sun, 02 Jan 2005 06:45:55 +0000 |
| Subject: | #31377 [Opn->Fbk]: is_dir function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-71385@lists.php.net to get a copy of this message | ||
ID: 31377
Updated by: sniper@php.net
Reported By: intro at intro dot one dot pl
-Status: Open
+Status: Feedback
-Bug Type: Unknown/Other Function
+Bug Type: Directory function related
Operating System: linux
PHP Version: 5.0.3
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
Also, add 'var_dump($files);' after the scandir() line and check the
output. (permissions..?)
Previous Comments:
------------------------------------------------------------------------
[2005-01-02 00:18:27] intro at intro dot one dot pl
Description:
------------
For example i have 4 folders in /home directory on unix platform
(a,b,c,d) and php5. The script:
I have strange thing that function is_dir not always shows every dirs
as it is dir. In my example script is_dir returned only "c" as dir and
the rest (a,b,d) as file.
Reproduce code:
---------------
<?php
$files=scandir("/home");
foreach ($files as $file)
{
if (is_dir($file))
{
echo "dir: $file";
}
}
?>
Expected result:
----------------
dir: a dir: b dir: c dir: d
Actual result:
--------------
dir: c
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31377&edit=1