#48771 [Opn]: rename() between drives error: No error

[email protected] ("bugs at thundercall dot dk")
Newsgroups php.bugs
Message-ID <[email protected]>
 ID:               48771
 User updated by:  bugs at thundercall dot dk
 Reported By:      bugs at thundercall dot dk
 Status:           Open
 Bug Type:         Filesystem function related
 Operating System: Windows XP
 PHP Version:      5.3CVS-2009-07-02 (snap)
 New Comment:

$handle = rename($old_file, $new_file);

$old_dir & $new_dir was meant for is_dir() checking before moving
files,... but as this test didn't needed that, i forgot to remove it
from the rename(),.. merged it into $old_file & $new_file.


Previous Comments:
------------------------------------------------------------------------

[2009-07-02 07:51:53] 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!


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=48771&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.