ID:               49900
 Updated by:       [email protected]
 Reported By:      wloske at yahoo dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         SPL related
 Operating System: Win XP SP2
 PHP Version:      5.2.11
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

err, that's because \r is carriare return inside "" ?


Previous Comments:
------------------------------------------------------------------------

[2009-10-16 13:21:38] wloske at yahoo dot de

Description:
------------
The RecursiveIteratorIterator fails when the variable containing the
path name to be traversed contains "root" anywhere.

Scanning a directory containing a folder named root works though.

1. Try the code, nothing should happen.
2. Rename the directory to "woot" and adjust the $basedir variabel
3. Restart the code. You should see a result
4. Make a directory like test and a directory inside named "root" with
some content in it.
5. Adjust $basedir to point to the parent of "root", e.g. "e:\test"
6. Restart. You should see the contents of test including the folder
"root".
7. Adjust $basedir to point to "root" itself, e.g. "E:\test\root"
8. Restart. You should see nothing


Reproduce code:
---------------
$basedir = realpath("E:\root");

echo "<html><body><pre>";

foreach (new RecursiveIteratorIterator(new
RecursiveDirectoryIterator($basedir,
RecursiveDirectoryIterator::KEY_AS_PATHNAME),
RecursiveIteratorIterator::CHILD_FIRST) as $file => $info) {
    if ($info->isDir()) {
        //Directory
        echo "Dir:  ".$file."<br />";
    } else {
        //File
        echo "File: ".$file."<br />";
        
    }
}
echo "</pre></body><html>";

Expected result:
----------------
A list of directories in the given path.

Actual result:
--------------
Nothing. Neither a listing nor an error. Just plain silence.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49900&edit=1

Reply via email to