From:             plesek at nln dot cz
Operating system: Windows XP Professional SP2
PHP version:      4.4.1
PHP Bug Type:     Directory function related
Bug description:  is_dir and is_file not working properly

Description:
------------
The behavior of following code is rather unpredictable. In the case of
opendir("."), all works perfecty, but if you add something like
/anotherdir, then you run into problems. In this example, let's assume we
have dir structure ./whatever/ with another 2 folders and files. The
result CAN be, as following, but it happened to me, that all dirs were
recognized correctly or for example only one was. Only special dirs, . and
.. are recognized. I tried several tips, that were on the internet, like
ending slash, or backslashes instead of normal ones (windows), with no
result. And on different folders, again the same, with minor fluctuations,
as mentioned above.
And as for is_file, te result will be all false in any case, tried several
times.Again, it applies only for other directories, than "."
All extensions disabled,of course.

Reproduce code:
---------------
$handler=opendir("./whatever");
while($element=readdir($handler)) {
$tmp=is_dir($element);
var_dump($tmp);
echo " $element<br/>";
}

Expected result:
----------------
bool(true) dir1
bool(true) dir2
bool(false) file1.txt
bool(false) file2.txt

Actual result:
--------------
bool(false) dir1
bool(false) dir2
bool(false) file1.txt
bool(false) file2.txt

-- 
Edit bug report at http://bugs.php.net/?id=35635&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=35635&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=35635&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=35635&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=35635&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=35635&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=35635&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=35635&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=35635&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=35635&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=35635&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=35635&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=35635&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=35635&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=35635&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=35635&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=35635&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=35635&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=35635&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=35635&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=35635&r=mysqlcfg

Reply via email to