This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Resolve issue #74974: document File::Copy::copy(FILE, DIR)
authorAbigail <abigail@abigail.be>
Tue, 8 Jun 2010 14:35:52 +0000 (16:35 +0200)
committerAbigail <abigail@abigail.be>
Tue, 8 Jun 2010 14:35:52 +0000 (16:35 +0200)
lib/File/Copy.pm

index c3823ac..eed6a53 100644 (file)
@@ -499,6 +499,12 @@ be opened for reading. Likewise, the second argument will be
 written to (and created if need be).  Trying to copy a file on top
 of itself is a fatal error.
 
+If the destination (second argument) already exists and is a directory,
+and the source (first argument) is not a filehandle, then the source
+file will be copied into the directory specified by the destination,
+using the same base name as the source file.  It's a failure to have a
+filehandle as the source when the destination is a directory.
+
 B<Note that passing in
 files as handles instead of names may lead to loss of information
 on some operating systems; it is recommended that you use file