This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
writing to the root directory requires elevated privileges
[perl5.git] / ext / File-Find / t / find.t
index b0e30eb..bca797e 100644 (file)
@@ -1026,11 +1026,13 @@ if ($^O eq 'MSWin32') {
         }
     }
     closedir $ROOT_DIR;
+  SKIP:
+    {
     my $created_file;
     unless (defined $expected_first_file) {
         $expected_first_file = '__perl_File_Find_test.tmp';
         open(F, ">", "/$expected_first_file") && close(F)
-            or die "cannot create file in root directory: $!\n";
+            or skip "cannot create file in root directory: $!", 8;
         $created_file = 1;
     }
 
@@ -1067,6 +1069,7 @@ if ($^O eq 'MSWin32') {
         unlink("/$expected_first_file")
             or warn "can't unlink /$expected_first_file: $!\n";
     }
+    }
 }
 
 {