This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
v5.8.8: File::Temp.pm (_gettemp): ignore dir -w test on Cygwin
authorJari Aalto <jari.aalto@poboxes.com>
Sat, 5 Jan 2008 13:22:17 +0000 (15:22 +0200)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 7 Jan 2008 16:55:44 +0000 (16:55 +0000)
Message-ID: <bq8034ba.fsf@blue.sea.net>

p4raw-id: //depot/perl@32892

lib/File/Temp.pm

index 120b532..e77bb82 100644 (file)
@@ -203,7 +203,7 @@ Exporter::export_tags('POSIX','mktemp','seekable');
 
 # Version number
 
-$VERSION = '0.20';
+$VERSION = '0.20_01';
 
 # This is a list of characters that can be used in random filenames
 
@@ -462,7 +462,13 @@ sub _gettemp {
     ${$options{ErrStr}} = "Parent directory ($parent) is not a directory";
     return ();
   }
-  unless (-w $parent) {
+
+  if ( $^O eq 'cygwin' ) {
+      # No-op special case. Under Windows Cygwin (FAT32) the directory
+      # permissions cannot be trusted. Directories are always
+      # writable.
+  }
+  elsif (not -w $parent) {
     ${$options{ErrStr}} = "Parent directory ($parent) is not writable\n";
       return ();
   }