This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
File::Copy: support symlinks on Win32
authorTony Cook <tony@develop-help.com>
Wed, 7 Oct 2020 01:08:30 +0000 (12:08 +1100)
committerTony Cook <tony@develop-help.com>
Tue, 1 Dec 2020 04:29:33 +0000 (15:29 +1100)
lib/File/Copy.pm
lib/File/Copy.t

index 63609cc..ac98cc2 100644 (file)
@@ -24,7 +24,7 @@ sub syscopy;
 sub cp;
 sub mv;
 
-$VERSION = '2.34';
+$VERSION = '2.35';
 
 require Exporter;
 @ISA = qw(Exporter);
@@ -100,7 +100,7 @@ sub copy {
     }
 
     if ((($Config{d_symlink} && $Config{d_readlink}) || $Config{d_link}) &&
-       !($^O eq 'MSWin32' || $^O eq 'os2')) {
+       !($^O eq 'os2')) {
        my @fs = stat($from);
        if (@fs) {
            my @ts = stat($to);
index 57d9478..f21c871 100644 (file)
@@ -164,7 +164,10 @@ for my $cross_partition_test (0..1) {
     open(F, ">", "file-$$") or die $!;
     print F "dummy content\n";
     close F;
-    symlink("file-$$", "symlink-$$") or die $!;
+    if (!symlink("file-$$", "symlink-$$")) {
+        unlink "file-$$";
+        skip "Can't create symlink", 3;
+    }
 
     my $warnings = '';
     local $SIG{__WARN__} = sub { $warnings .= join '', @_ };