Re: Not OK: perl v5.9.0 +DEVEL17881 on i386-freebsd 4.6-release (UNINSTALLED)
[p5sagit/p5-mst-13.2.git] / lib / File / Copy.pm
index 31fad2a..08da5e5 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);
@@ -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,