|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30089 When renaming current dir changes to nothing
Submitted: 2004-09-15 00:25 UTC Modified: 2004-10-10 01:00 UTC
From: jeppe at bundsgaard dot net Assigned:
Status: No Feedback Package: Filesystem function related
PHP Version: 4.3.8 OS: FreeBSD 5.2.1-RC
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-09-15 00:25 UTC] jeppe at bundsgaard dot net
When renaming a directory, say ../mydir to ../del/mydir, it seems that php forget the current dir - sets it to nothing. I can resolve the problem by getting the current dir (getcwd) before the rename and setting it after (chdir).

It seems that the problem exists when renaming from a dir that is one level smaller than the rename-to dir - so when renaming from ../mydir/subdir to ../del/subdir - everything is ok. 

I admit: This sounds strange. So it took me some time to locate the problem.

And yes: I am sure that ../del exists - this script has been working without problems on a lot of versions of php, a lot of webhotels and a lot of different setups.

Reproduce code:
echo "First: ".getcwd();
echo "<br>And second: ".getcwd();

Expected result:
First: /usr/home/web/web33953/kursus/admin
And second: /usr/home/web/web33953/kursus/admin

Actual result:
First: /usr/home/web/web33953/kursus/admin
And second: 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-01 21:05 UTC]
Please try using this CVS snapshot:
For Windows:

I can not reproduce this with latest CVS snapshot using CLI.
Please try with the CLI binary. And if it works, do tell us what webserver you might be using..

 [2004-10-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Jan 22 21:01:24 2020 UTC