php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50932 RuntimeException: SplFileInfo::getType() [splfileinfo.gettype]: Lstat
Submitted: 2010-02-04 18:54 UTC Modified: 2018-09-02 09:33 UTC
Votes:4
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: draeli at draeli dot com Assigned: cmb (profile)
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 18:54 UTC] draeli at draeli dot com
Description:
------------
Under Windows (XP Sp3), I have create a dir (with mkdir function) named 'Chouja Reideen - Love is..', when I read dir with SPL "RecursiveDirectoryIterator" and call method 'getType', I have this error message : "RuntimeException: SplFileInfo::getType() [splfileinfo.gettype]: Lstat".
Too, when I try to rename (with rename function), I have this error message "No such file or directory".
Dir really exist (with "getPathname" call method, name is correct) and I can't rename with system rename properties or MSDos rename function (and I have no solution to remove this dir ...).

Reproduce code:
---------------
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator('E:\directoryTest'), \RecursiveIteratorIterator::SELF_FIRST) as $objCur) {
	echo '<hr />';
	if ( preg_match('@^E:\\\directoryTest(.*)\.+$@U', $objCur->getPathname(), $out) ){
		rename($objCur->getPathname(), 'E:\directoryTest\\' . $out[1]);
		var_dump($out[1]);
	}
	echo $objCur->getPathname() . '<br />';
	echo $objCur->getType() . '<br />';
}

Expected result:
----------------
List all file under a primary dir and rename file finish with one or more commat.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-04 23:12 UTC] draeli at draeli dot com
I realized that I had used the wrong word in 'Expected result' part.
Problem is with 'dot' and not 'commat'.
Sorry for this miss.
 [2018-08-18 13:11 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2018-08-18 13:11 UTC] cmb@php.net
> […] I can't rename with system rename properties or MSDos rename
> function […]

Then why do you think this would be a PHP issue?

> […] and I have no solution to remove this dir […]

Use the folders short name (see `dir /X`).
 [2018-09-02 09:33 UTC] cmb@php.net
-Status: Feedback +Status: No Feedback
 [2018-09-02 09:33 UTC] cmb@php.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 "Re-Opened". Thank you.
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Tue Oct 16 12:01:26 2018 UTC