#21921 [NEW]: opendir / readdir bug anytime
| From: | emmanuel dot leleu at delta-development dot fr | Date: | Tue, 28 Jan 2003 15:09:42 +0000 |
| Subject: | #21921 [NEW]: opendir / readdir bug anytime | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-31465@lists.php.net to get a copy of this message | ||
From: emmanuel.leleu@delta-development.fr
Operating system: ALL
PHP version: 4.2.0
PHP Bug Type: *Directory/Filesystem functions
Bug description: opendir / readdir bug anytime
PHP : all version
System : all system
--------------------
i find a "little problem" !
create a dir "testmanu"
inside create another dir named "titi" and another dir named "0" (zero)
( testmanu / titi , 0 )
and try to use opendir and readdir (recursif) for find inside any dir/file
=bug ! Why ? because a dir is named "0" !
look and try :
<?php
// Emmanuel LELEU - emmanuel.leleu@delta-development.fr /
manu@cyklades.com
// EL - fReadRecursif - v1.0 - 28/01/2003 16:02
function fReadRecursif($sPath)
{
Global $sChemin;
if (!$pListe = @opendir($sChemin.$sPath))
echo "<br>fReadRecursif - chemin introuvable : $sPath";
echo "<br>path in progress : ".$sChemin.$sPath;
while ($sDir = @readdir($pListe))
{
echo "<br>found : ".$sDir;
if ($sDir!= "." && $sDir != "..")
{
if (is_dir($sChemin.$sPath."/".$sDir))
{
fReadRecursif($sPath."/".$sDir);
}
}
}
@closedir($pListe);
}
$sChemin = "./";
fReadRecursif("testmanu");
?>
manu
--
Edit bug report at http://bugs.php.net/?id=21921&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=21921&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=21921&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=21921&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=21921&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=21921&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=21921&r=support
Expected behavior: http://bugs.php.net/fix.php?id=21921&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=21921&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=21921&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=21921&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21921&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=21921&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=21921&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=21921&r=gnused