ID: 50934 Updated by: [email protected] -Summary: UnexpectedValueException: RecursiveDirectoryIterato Reported By: draeli at draeli dot com -Status: Open +Status: Feedback Bug Type: SPL related -Operating System: Windows +Operating System: win32 only - Windows PHP Version: 5.3.1 New Comment:
Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Previous Comments: ------------------------------------------------------------------------ [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
