#41985 [Bgs->Opn]: rename doesn't work

From: Date: Fri, 13 Jul 2007 20:57:49 +0000
Subject: #41985 [Bgs->Opn]: rename doesn't work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115048@lists.php.net to get a copy of this message
ID: 41985 User updated by: marc dot bau at gmx dot net Reported By: marc dot bau at gmx dot net -Status: Bogus +Status: Open Bug Type: Filesystem function related Operating System: Windows PHP Version: 5.2.3 New Comment: Do you know how this works on *nix systems? Well i will tell you - it will *move* the "new file" over the "old file" in an atomic rename. This is what PHP needs to handle on Windows, too. I don't need any extras on *nix to rename. And PHP internal command should work platform independent. This bug should be fixed to make sure the code runs on windows in the *same way* as it does on *nix systems. What is so difficult to understand about this? Writing write code once, *run everywhere* is not possible with this bug. Previous Comments: ------------------------------------------------------------------------ [2007-07-13 20:48:09] tony2001@php.net Please open a dictionary and translate the error message: PHP Warning: rename(C:\temp\tmp_file.txt.new,C:\temp\tmp_file.txt): ****File exists**** in C:\Temp\rename-test.php on line 2 It says FILE EXISTS, don't you see it? Please do NOT reopen the report again. Thank you. ------------------------------------------------------------------------ [2007-07-13 20:36:36] marc dot bau at gmx dot net As already said, this won't help anything. DON'T WORK: <?php rename('C:\temp\tmp_file.txt.new', 'C:\temp\tmp_file.txt'); ?> Error: PHP Warning: rename(C:\temp\tmp_file.txt.new,C:\temp\tmp_file.txt): File exists in C:\Temp\rename-test.php on line 2 DON'T WORK: <?php rename('C:\\temp\\tmp_file.txt.new', 'C:\\temp\\tmp_file.txt'); ?> Error: PHP Warning: rename(C:\temp\tmp_file.txt.new,C:\temp\tmp_file.txt): File exists in C:\Temp\rename-test.php on line 2 DON'T WORK: <?php rename("C:\\temp\\tmp_file.txt.new", "C:\\temp\\tmp_file.txt"); ?> Error: PHP Warning: rename(C:\temp\tmp_file.txt.new,C:\temp\tmp_file.txt): File exists in C:\Temp\rename-test.php on line 2 DON'T WORK: <?php rename("C:/temp/tmp_file.txt.new", "C:/temp/tmp_file.txt"); ?> Error: PHP Warning: rename(C:/temp/tmp_file.txt.new,C:/temp/tmp_file.txt): File exists in C:\Temp\rename-test.php on line 2 So you have a Windows Box next to you? Before answering, test yourself if you don't trust me, but don't close this case until this bug has been fixed! THX. ------------------------------------------------------------------------ [2007-07-13 18:44:15] tony2001@php.net Please escape the \ as advised in the manual. ------------------------------------------------------------------------ [2007-07-13 18:33:37] marc dot bau at gmx dot net This doesn't have anything to do with double quotes. With single quotes this isn't working, too. <?php rename('C:\temp\tmp_file.txt.new', 'C:\temp\tmp_file.txt'); ?> ------------------------------------------------------------------------ [2007-07-13 09:30:47] tony2001@php.net http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.double ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/41985 -- Edit this bug report at http://bugs.php.net/?id=41985&edit=1

« previous php.bugs (#115048) next »