#21425 [Fbk->Opn]: rename() - interesting behaviour
| From: | linux at psoftwares dot hu | Date: | Sun, 05 Jan 2003 13:35:03 +0000 |
| Subject: | #21425 [Fbk->Opn]: rename() - interesting behaviour | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-29105@lists.php.net to get a copy of this message | ||
ID: 21425
User updated by: linux@psoftwares.hu
Reported By: linux@psoftwares.hu
-Status: Feedback
+Status: Open
Bug Type: Filesystem function related
Operating System: Debian GNU/Linux
PHP Version: 4.3.0
New Comment:
perms of the file:
-rw-r--r-- 1 phanatic phanatic 99 Jan 5 10:36 users
perms of the dir:
drwxr-xr-x 5 phanatic phanatic 4096 Jan 5 12:06 temp
but in my opinion, if this happens because of the permissions, then why
does the second script work?
thanx in advance...
Previous Comments:
------------------------------------------------------------------------
[2003-01-05 07:24:20] nicos@php.net
Can you please show us the permission of the directory and of the files
please?
It looks I really CAN NOT reproduce it there...
Thank you.
------------------------------------------------------------------------
[2003-01-05 07:21:23] linux@psoftwares.hu
the file is there, i'm sure about it... and the script itself is in
'/home/phanatic/temp', too!!! so it's not a bogus in my opinion... just
test it yourself.
------------------------------------------------------------------------
[2003-01-05 07:13:40] nicos@php.net
The error is clear it can't find /home/phanatic/temp/users, probably
because of permissions or probably because it's NOT the good directory.
Are you sure ./ is /home/phanatic/temp/?
Anyway this is bogus, if you need any help please take a look at
http://www.php.net/support.php .
Thank you for your report.
------------------------------------------------------------------------
[2003-01-05 05:16:29] linux@psoftwares.hu
it's an interesting thing about the rename() function:
the code which doesn't work:
<?php
$base = "/home/phanatic/temp/";
$from = "users";
$to = "userdata";
rename ($base.$from, $base.$to);
?>
and which works (if the script is in the same dir):
<?php
$from = "users";
$to = "userdata";
rename ("./".$from, "./".$to);
?>
error message for the first code:
Warning: rename(/home/phanatic/temp/users,/home/phanatic/temp/userdata)
[http://www.php.net/function.rename]: No such file or directory in
/home/phanatic/temp/test_rename.php on line 8
my configure line:
./configure --with-layout=GNU --with-mysql=shared --with-pgsql=shared
--with-gd=shared --with-gd2 --enable-ftp --with-calendar --with-posix
--
enable-sockets --enable-cli --enable-cgi --enable-pcntl
--with-bz2=shared --with-zlib-dir=/usr/include/ --prefix=/usr
--sysconfdir=/etc/php
hope i could provide all the infos needed to fix this problem...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21425&edit=1