note 55733 added to function.rename
| From: | tomfelker at gmail dot com | Date: | Thu, 11 Aug 2005 21:51:54 +0000 |
| Subject: | note 55733 added to function.rename | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93465@lists.php.net to get a copy of this message | ||
Actually, I'm pretty sure that rename follows the convention of *nix rename(2) in overwriting
the destination if it exists atomically (meaning that no other process will see the destination
cease to exist, even for an instant). This is useful because it allows you to build a file as a
temp file, then rename it to where you want it to be, and nobody sees the file when it's half
done.
Probably rename($old, $new) with an existing new was caused by permission problems. I bet the other
problems you had were the result of not calling clearstatcache(), which can cause PHP to act like a
file exists though it has since been deleted.
----
Manual Page -- http://www.php.net/manual/en/function.rename.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55733
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55733&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55733&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55733&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55733&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55733&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55733&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55733&report=yes
Search -- http://master.php.net/manage/user-notes.php