php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36844 Rename file does not work in file already exists
Submitted: 2006-03-24 13:32 UTC Modified: 2006-03-24 13:33 UTC
From: astro101 at hotmail dot com Assigned:
Status: Not a bug Package: Directory function related
PHP Version: 5.1.3RC1 OS: Win XP SP2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: astro101 at hotmail dot com
New email:
PHP Version: OS:

 

 [2006-03-24 13:32 UTC] astro101 at hotmail dot com
Description:
------------
When trying to rename a file to a file name that already exists script fails

Reproduce code:
---------------
$file = fopen($filename, 'w');
fwrite($file, "Data");
fclose($file);
$rv = rename($filename,$Exitingfile);

Expected result:
----------------
I would expect the existing file to be overidden and now have the new data in it.

Actual result:
--------------
The existing file remains aswell as the new file.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-24 13:33 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 02 12:01:29 2025 UTC