Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: File::Inplace module is altering file permissions/ownership

by Anonymous Monk
on Mar 04, 2007 at 05:56 UTC ( #603105=note: print w/replies, xml ) Need Help??


in reply to File::Inplace module is altering file permissions/ownership

So, what is Inplace doing and how and why is it changing permissions? And how can I stop it?
Investigate.
http://search.cpan.org/src/CHIPT/File-Inplace-0.20/lib/File/Inplace.pm
No chmod, no umask, uses File::Copy, File::Temp
http://search.cpan.org/src/NWCLARK/perl-5.8.8/lib/File/Copy.pm
No chmod, no umask
http://search.cpan.org/src/NWCLARK/perl-5.8.8/lib/File/Temp.pm
Bingo
# Internal routine to force a temp file to be writable after # it is created so that we can unlink it. Windows seems to occassional +ly # force a file to be readonly when written to certain temp locations sub _force_writable { my $file = shift; my $umask = umask(); umask(066); chmod 0600, $file; umask($umask) if defined $umask; }
With a umask of 066 only the creator of the file will be able to read or write to the file. File::Inplace needs to account for this behaviour.

Replies are listed 'Best First'.
Re^2: File::Inplace module is altering file permissions/ownership
by mojodaddy (Pilgrim) on Mar 05, 2007 at 04:11 UTC
    Thank you, o inscrutable one. I shall ponder this until its meaning is revealed to me.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://603105]
help
Chatterbox?
[1nickt]: See this code. (I expected to simply eval loading threads as a check, but weirdness happened with Perlbrew so it's a grep of -V ...)
[choroba]: Config might be better than grepping -V
[Corion]: Also see Config::V, which is less of that hackery, or that hackery hidden in a module ;)
[1nickt]: The problem was with Perlbrew
[Corion]: Whoops - Config::Perl::V
[1nickt]: I found that when using Perlbrew as recommended, with cpanminus in the system perl lib, such tests were failing to detect the data about the perl that was the install destination.

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2017-10-18 15:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (249 votes). Check out past polls.

    Notices?