#50934 [Fbk->Opn]: UnexpectedValueException: RecursiveDirectoryIterator
| From: | draeli at draeli dot com | Date: | Thu, 04 Feb 2010 21:52:44 +0000 |
| Subject: | #50934 [Fbk->Opn]: UnexpectedValueException: RecursiveDirectoryIterator | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-147242@lists.php.net to get a copy of this message | ||
ID: 50934
User updated by: draeli at draeli dot com
Reported By: draeli at draeli dot com
-Status: Feedback
+Status: Open
Bug Type: SPL related
Operating System: win32 only - Windows
PHP Version: 5.3.1
New Comment:
I use the latest (I have download, install and try before report).
Previous Comments:
------------------------------------------------------------------------
[2010-02-04 20:37:05] jani@php.net
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[2010-02-04 19:30:05] draeli at draeli dot com
Description:
------------
Under Windows (XP Sp3) I want to remove files and dir recursively.
When dir contain '-' (dash symbol), error message
"UnexpectedValueException:
RecursiveDirectoryIterator::__construct(E:\directoryTest\name - file)
[recursivedirectoryiterator.--construct]: failed to open dir: No such
file or directory in" is call and script is stop after loop
(consequently dir is really remove)
Reproduce code:
---------------
foreach (new \RecursiveIteratorIterator(new
\RecursiveDirectoryIterator('E:\directoryTest'),
\RecursiveIteratorIterator::SELF_FIRST) as $objCur) {
if ( $objCur->isDir() ){
rmdir($objCur->getPathname());
}else{
unlink($objCur->getPathname());
}
}
Expected result:
----------------
I try to remove file and dir recurvely since one dir.
Actual result:
--------------
Actual result is file are delete, dir too but script stop after loop if
current read dir contain dash symbol.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50934&edit=1