Integrate podlators-1.25
[p5sagit/p5-mst-13.2.git] / lib / File / Copy.pm
index 31fad2a..5c5f0f3 100644 (file)
@@ -33,6 +33,13 @@ require Exporter;
 
 $Too_Big = 1024 * 1024 * 2;
 
+my $macfiles;
+if ($^O eq 'MacOS') {
+       $macfiles = eval { require Mac::MoreFiles };
+       warn 'Mac::MoreFiles could not be loaded; using non-native syscopy'
+               if $@ && $^W;
+}
+
 sub _catname {
     my($from, $to) = @_;
     if (not defined &basename) {
@@ -230,8 +237,7 @@ unless (defined &syscopy) {
            return 0 unless @_ == 2;
            return Win32::CopyFile(@_, 1);
        };
-    } elsif ($^O eq 'MacOS') {
-       require Mac::MoreFiles;
+    } elsif ($macfiles) {
        *syscopy = sub {
            my($from, $to) = @_;
            my($dir, $toname);
@@ -263,13 +269,13 @@ File::Copy - Copy files or filehandles
 
 =head1 SYNOPSIS
 
-       use File::Copy;
+       use File::Copy;
 
-       copy("file1","file2");
-       copy("Copy.pm",\*STDOUT);'
+       copy("file1","file2") or die "Copy failed: $!";
+       copy("Copy.pm",\*STDOUT);
        move("/dev1/fileA","/dev2/fileB");
 
-       use POSIX;
+       use POSIX;
        use File::Copy cp;
 
        $n = FileHandle->new("/a/file","r");
@@ -338,6 +344,9 @@ VMS systems, this calls the C<rmscopy> routine (see below).  For OS/2
 systems, this calls the C<syscopy> XSUB directly. For Win32 systems,
 this calls C<Win32::CopyFile>.
 
+On Mac OS (Classic), C<syscopy> calls C<Mac::MoreFiles::FSpFileCopy>,
+if available.
+
 =head2 Special behaviour if C<syscopy> is defined (OS/2, VMS and Win32)
 
 If both arguments to C<copy> are not file handles,