php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41354 rename() file not found error message is ambigous
Submitted: 2007-05-10 14:11 UTC Modified: 2010-12-22 13:30 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: cbutler at technophobia dot co dot uk Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.2 OS: Debian GNU/Linux
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: cbutler at technophobia dot co dot uk
New email:
PHP Version: OS:

 

 [2007-05-10 14:11 UTC] cbutler at technophobia dot co dot uk
Description:
------------
The error message given by rename() when one of its arguments doesn't exist does not distinguish which argument is at fault. This can make tracking down problems more difficult.

Reproduce code:
---------------
fclose(fopen("testfile", "w")); 
echo "bad 1st arg";
rename("nonexistantfile", "test");
echo "bad 2nd arg";
rename("testfile", "non/existant/dir"); 


Expected result:
----------------
bad 1st arg
Warning: rename(nonexistantfile,test): nonexistantfile: No such file or directory in Command line code on line 3
bad 2nd arg
Warning: rename(testfile,non/existant/dir): non/existant/dir: No such file or directory in Command line code on line 5


Actual result:
--------------
bad 1st arg
Warning: rename(nonexistantfile,test): No such file or directory in Command line code on line 3
bad 2nd arg
Warning: rename(testfile,non/existant/dir): No such file or directory in Command line code on line 5


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-22 13:30 UTC] johannes@php.net
-Status: Open +Status: Bogus -Package: Feature/Change Request +Package: *General Issues
 [2010-12-22 13:30 UTC] johannes@php.net
The error is caused by the operating system. We can't be more precise.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sun May 24 10:00:01 2026 UTC