2011/9/9 Chad Wallace <cwall...@lodgingcompany.com>:
> On Fri, 9 Sep 2011 01:31:17 +0300
> Oleg Kostyuk <cub.ua...@gmail.com> wrote:
>
>> I think, this will better show what you wanted to say to all:
>>
>> dev% umask
>> 0777
>> dev% touch foo
>> dev% perl -MFile::Temp -le '$File::Temp::KEEP_ALL=1;
>> File::Temp->new(DIR => ".");'
>> dev% ls -l
>> total 0K
>> ---------- 1 cub cub 0 2011-09-09 01:04 foo
>> -rw------- 1 cub cub 0 2011-09-09 01:04 RSdAy0ZtMR
>>
>> So, when you told that File::Temp don't honor umask, and sets
>> permissions explicitly, you was correct - this is really so. Looking
>> at sources confirms that File::Temp use explicit "chmod 0600". And
>> perldoc for chmod don't tell anything about umask. Seems, Perl is not
>> very obvious here. Moreover:
>>
>> dev% umask
>> 0777
>> dev% perl -e 'print umask'
>> 511
>> dev% umask 0002
>> dev% perl -e 'print umask'
>> 2
>>
>> Not sure why this is so. This seems to be interesting and need to be
>> investigated additionally. At least, perldoc don't made me clear about
>> why chmod and umask works in such way in Perl.
>
> 511 is decimal for octal 777:
>
> cwallace@ws80:~$ perl -e 'print oct("777"), "\n"'
> 511
> cwallace@ws80:~$ umask
> 0777
> cwallace@ws80:~$ perl -e 'printf "%04o\n", umask'
> 0777
>

> Also, umask doesn't affect chmod because umask is only for file
> creation.

It's shame to forget about this :) Thanks for remind!

>
>
> _______________________________________________
> templates mailing list
> templates@template-toolkit.org
> http://mail.template-toolkit.org/mailman/listinfo/templates
>



-- 
Sincerely yours,
Oleg Kostyuk (CUB-UANIC)

_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to