[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Perl File::Temp and umask



I'm having some issues with perl File::Temp.  The temporary file created
does not follow the umask permissions.  For example, given the following
code:

#!/usr/bin/perl
use File::Temp tempfile;
umask 022;
open my $tmp, ">/tmp/myfile.tmp";
open my ($fh,$filename) = tempfile('/tmp/myfile.tmp.XXXXXX');
close $fh;
print $filename."\n";

After running this, the output of 'ls -l /tmp/myfile.tmp*' looks
something like this:

-rw-r--r-- 1 casey casey 0 2006-04-18 11:42 /tmp/myfile.tmp
-rw------- 1 casey casey 0 2006-04-18 11:42 /tmp/myfile.tmp.aOD2ZC

Any ideas as to why umask is not working on tempfile?  According to the
docs, it should [1].

Casey

[1] http://search.cpan.org/~tjenness/File-Temp-0.16/Temp.pm




Reply to: