#21921 [Opn->Bgs]: opendir / readdir bug anytime

From: Date: Tue, 28 Jan 2003 15:33:17 +0000
Subject: #21921 [Opn->Bgs]: opendir / readdir bug anytime
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-31468@lists.php.net to get a copy of this message
ID: 21921 Updated by: wez@php.net Reported By: emmanuel.leleu@delta-development.fr -Status: Open +Status: Bogus Bug Type: *Directory/Filesystem functions Operating System: ALL PHP Version: 4.2.0 New Comment: Please read the manual for readdir() which explains how to deal with this. http://php.net/readdir Previous Comments: ------------------------------------------------------------------------ [2003-01-28 09:09:42] emmanuel.leleu@delta-development.fr 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 this bug report at http://bugs.php.net/?id=21921&edit=1

« previous php.bugs (#31468) next »