|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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! PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
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?