php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50934 UnexpectedValueException: RecursiveDirectoryIterator
Submitted: 2010-02-04 19:30 UTC Modified: 2013-02-18 00:34 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: draeli at draeli dot com Assigned:
Status: No Feedback Package: SPL related
PHP Version: 5.3.1 OS: win32 only - Windows
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-02-04 19:30 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-04 20:37 UTC] 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 21:52 UTC] draeli at draeli dot com
I use the latest (I have download, install and try before report).
 [2010-02-26 00:19 UTC] kalle@php.net
Does this work in 5.2.x ?
 [2010-03-05 06:01 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 [2010-04-25 20:18 UTC] felipe@php.net
-Status: No Feedback +Status: Feedback
 [2010-04-25 20:18 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 21:01:28 2024 UTC