From 0127ad913f70df9460c0a31676723ff17a00d4ca Mon Sep 17 00:00:00 2001 From: Aidan Lister Date: Mon, 30 Aug 2004 07:32:21 +0000 Subject: [PATCH] Simplified example Added note about windows compatability git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@167602 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/filesystem/functions/copy.xml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/reference/filesystem/functions/copy.xml b/reference/filesystem/functions/copy.xml index bbbce6f67b..bee39897bf 100644 --- a/reference/filesystem/functions/copy.xml +++ b/reference/filesystem/functions/copy.xml @@ -1,5 +1,5 @@ - + @@ -21,8 +21,11 @@ \n"; +$file = 'example.txt'; +$newfile = 'example.txt.bak'; + +if (!copy($file, $newfile)) { + echo "failed to copy $file...\n"; } ?> ]]> @@ -46,6 +49,13 @@ if (!copy($file, $file.'.bak')) { If the destination file already exists, it will be overwritten. + + + Windows Compatability Note: If you copy a file with no size, + copy will return false, but the file will be correctly + copied. + + See also move_uploaded_file, rename, and the section of the manual