PHP :: Bug #48771 :: rename() between drives error: No error
| Bug #48771 | rename() between drives error: No error | ||||
|---|---|---|---|---|---|
| Submitted: | 2009-07-02 07:51 UTC | Modified: | 2012-08-12 08:37 UTC | ||
| From: | bugs at thundercall dot dk | Assigned: | pajoye (profile) | ||
| Status: | Closed | Package: | Filesystem function related | ||
| PHP Version: | 5.3CVS-2009-07-02 (snap) | OS: | win32 only - Windows XP | ||
| Private report: | No | CVE-ID: | None | ||
[2009-07-02 07:51 UTC] bugs at thundercall dot dk
Description: ------------ When using rename() from one drive to another drive PHP5.3 & Snap 5.3.1 2009-07-02 fails with error: "No error" and doesn't move the file... Reproduce code: --------------- <?php $old_file = "C:\\Temp\\file.txt"; $new_file = "D:\\Temp\\newfile.txt"; $handle = rename($old_dir.$old_file, $new_dir.$new_file); if ($handle) print "Wuhoo!!"; else print "Do'h!"; // $handle = rename($new_dir.$new_file, $old_dir.$old_file); // restore for reruns ?> Expected result: ---------------- Wuhoo!! Actual result: -------------- Warning: rename(C:\Temp\file.txt,D:\Temp\newfile.txt) [function.rename]: No error in D:\home\main\test\rename\index.php on line 6 Do'h!
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2009-07-02 07:55 UTC] bugs at thundercall dot dk
[2009-07-02 09:14 UTC] pajoye@php.net
[2009-07-06 09:09 UTC] pajoye@php.net
[2011-06-12 15:27 UTC] tijs_maas at hotmail dot com
I don't know if i am right but i think i also notice this bug. I do not even use absolute paths. I could use this function wrong or it is the bug, it sais: No error on line 19 $pathtothisfolder = explode("/", str_replace(array('//', '\\'),'/',dirname(__FILE__))); $pathtoUpperParent = ""; for( $i = 0; $i < count($pathtothisfolder) - 2; $i++ ) { $pathtoUpperParent .= $pathtothisfolder[$i]."/"; } $rootname = trim($pathtoUpperParent, versieDirPath()); $parents = count(explode("/", $rootname)) + 2; $parentpath = ""; while ($parents > 0 ) { $parentpath .= "../"; $parents --; } // voer de rename operatie uit rename($parentpath.$_GET['versie']."/", $parentpath."sdfsdf/" ); The paths i use are without drives, am I also affected by this bug?[2011-06-12 15:32 UTC] pajoye@php.net
[2012-08-02 19:25 UTC] luizael dot batista at gmail dot com
[2012-08-12 08:37 UTC] pajoye@php.net