|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-10-01 21:05 UTC] sniper@php.net
[2004-10-10 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 21:00:01 2025 UTC |
Description: ------------ 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: --------------- mkdir("../mydir",0777); mkdir("../del",0777); echo "First: ".getcwd(); rename("../mydir","../del/mydir"); 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: