![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
use File::Copy;
copy("file1","file2"); copy("Copy.pm",\*STDOUT);'
use POSIX; use File::Copy cp;
$n=FileHandle->new("/dev/null","r"); cp($n,"x");'
An optional third parameter can be used to specify the buffer size used for copying. This is the number of bytes from the first file, that wil be held in memory at any given time, before being written to the second file. The default buffer size depends upon the file, but will generally be the whole file (up to 2Mb), or 1k for filehandles that do not reference files (eg. sockets).
You may use the syntax use File::Copy "cp"
to get at the ``cp'' alias for this function. The syntax is exactly the same.
Return value:
Returns 1 on success, 0 on failure. $! will be set if an error was encountered.
Return value:
copydir returns true on success and false on failure, though failure to copy a single file or directory from the source tree may still result in ``success''. The return value simply indicates whether or not anything was done.
$CommentsMailTo = "perl5@dcs.ed.ac.uk"; include("../syssies_footer.inc");?>