#50934 [Opn->Fbk]: UnexpectedValueException: RecursiveDirectoryIterator
| From: | kalle@php.net | Date: | Fri, 26 Feb 2010 00:19:32 +0000 |
| Subject: | #50934 [Opn->Fbk]: UnexpectedValueException: RecursiveDirectoryIterator | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-148062@lists.php.net to get a copy of this message | ||
ID: 50934
Updated by: kalle@php.net
Reported By: draeli at draeli dot com
-Status: Open
+Status: Feedback
Bug Type: SPL related
Operating System: win32 only - Windows
PHP Version: 5.3.1
New Comment:
Does this work in 5.2.x ?
Previous Comments:
------------------------------------------------------------------------
[2010-02-04 21:52:44] draeli at draeli dot com
I use the latest (I have download, install and try before report).
------------------------------------------------------------------------
[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