note 54660 added to function.copy
| From: | donald at osu1 dot php dot net | Date: | Tue, 12 Jul 2005 05:46:53 +0000 |
| Subject: | note 54660 added to function.copy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-91785@lists.php.net to get a copy of this message | ||
Copying on some systems (Windows?) with the source and destination file the same truncates the file
to zero length. This caused me no end of headaches. Use:
<?php
if($src!=$dst) {
copy($src, $dst);
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.copy.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54660
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54660&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54660&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54660&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54660&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54660&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54660&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54660&report=yes
Search -- http://master.php.net/manage/user-notes.php