LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: comdog@cvs.perl.org Date: Mon Jun 23 11:16:40 2008 Subject: [svn:perlfaq] r11446 - perlfaq/trunk
Author: comdog Date: Mon Jun 23 10:16:39 2008 New Revision: 11446 Modified: perlfaq/trunk/perlfaq5.pod Log: * perlfaq5: How can I copy a file? + Note that if you copy the file yourself, you need to update the permissions, owner, and group on the new file Modified: perlfaq/trunk/perlfaq5.pod ============================================================================== --- perlfaq/trunk/perlfaq5.pod (original) +++ perlfaq/trunk/perlfaq5.pod Mon Jun 23 10:16:39 2008 @@ -302,11 +302,11 @@ C<.c.orig> file. =head2 How can I copy a file? -X<copy> X<file, copy> +X<copy> X<file, copy> X<File::Copy> (contributed by brian d foy) -Use the File::Copy module. It comes with Perl and can do a +Use the C<File::Copy> module. It comes with Perl and can do a true copy across file systems, and it does its magic in a portable fashion. @@ -314,9 +314,10 @@ copy( $original, $new_copy ) or die "Copy failed: $!"; -If you can't use File::Copy, you'll have to do the work yourself: +If you can't use C<File::Copy>, you'll have to do the work yourself: open the original file, open the destination file, then print -to the destination file as you read the original. +to the destination file as you read the original. You also have to +remember to copy the permissions, owner, and group to the new file. =head2 How do I make a temporary file name? X<file, temporary>
| Navigate in group perl.cvs.perlfaq at sever nntp.perl.org | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by PHP Developer
Powered By PHP Consultants |