|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #29812 rename() don't overwrite existing files at windows (as at linux)
Submitted: 2004-08-24 12:36 UTC Modified: 2013-12-07 22:49 UTC
Avg. Score:4.3 ± 1.0
Reproduced:17 of 17 (100.0%)
Same Version:3 (17.6%)
Same OS:12 (70.6%)
From: melker at kuh dot at Assigned:
Status: Duplicate Package: *General Issues
PHP Version: 4.3.8 OS: winxp
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
18 + 11 = ?
Subscribe to this entry?

 [2004-08-24 12:36 UTC] melker at kuh dot at

rename ( 'file1', 'file2' ); 

behaviour at linux:

If there is a 'file2', the file2 will be overwritten by file1.

at windows xp:
If there is a 'file2', a warning is given and the file2 isn't overwritten with file1.

Reproduce code:
rename ( 'file1', 'file2' ); 

Expected result:
I would expect, that rename() works with the same behaviour at all operating systems.

So, please overwrite existing files or give a warning at all os.

Actual result:
at linux, existing files will be overwritten, at winxp, the rename-process fails, a php-warning is given.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-05 11:16 UTC] tom at r dot je
This isn't restricted to Windows XP but also affects other versions. I've tested Windows Vista and Windows Server 2008, both have this same problem.
 [2013-12-07 14:08 UTC] cmbecker69 at gmx dot de
This request is a related to bug report #41985[1].

The issue is solved since PHP 5.3.

[1] <>
 [2013-12-07 22:49 UTC]
-Status: Open +Status: Duplicate -Package: Feature/Change Request +Package: *General Issues
 [2013-12-07 22:49 UTC]
Good catch. Closing as duplicate of bug #41985.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 09 09:05:53 2022 UTC