This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
for File::Temp::tempdir(CLEANUP => 1)
authorSlaven Rezic <slaven@rezic.de>
Sun, 17 Aug 2003 12:52:47 +0000 (14:52 +0200)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 22 Aug 2003 13:51:44 +0000 (13:51 +0000)
Message-Id: <200308171052.h7HAqlfo026317@vran.herceg.de>

p4raw-id: //depot/perl@20839

lib/File/Temp.pm
lib/File/Temp/t/tempfile.t

index 5d8dc7b..4b92033 100644 (file)
@@ -855,7 +855,7 @@ sub _can_do_level {
     # Dirs
     foreach my $dir (@dirs_to_unlink) {
       if (-d $dir) {
-       rmtree($dir, $DEBUG, 1);
+       rmtree($dir, $DEBUG, 0);
       }
     }
 
index 6e3fa94..c8739bf 100755 (executable)
@@ -3,7 +3,7 @@
 
 use strict;
 use Test;
-BEGIN { plan tests => 20}
+BEGIN { plan tests => 22}
 use File::Spec;
 
 # Will need to check that all files were unlinked correctly
@@ -88,6 +88,16 @@ push(@files, $tempfile);
 ok( (-f $tempfile ));
 push(@files, $tempfile);
 
+# Test tempfile
+# ..and another with changed permissions (read-only)
+($fh, $tempfile) = tempfile(
+                           DIR => $tempdir,
+                          );
+chmod 0444, $tempfile;
+
+ok( (-f $tempfile ));
+push(@files, $tempfile);
+
 print "# TEMPFILE: Created $tempfile\n";
 
 # and another (with template)