newbie00 has asked for the wisdom of the Perl Monks concerning the following question:
Does changing 'umask' change the system's default value or does it only apply for the current code and does not affect the system's default value?
Also, what is the result of the 'mkdir' on the directory created if the mode that is specified is different than the default 'umask' if the 'umask' statment is not used in the code?
What I mean is, if e.g.
...when the umask default is 0755. Will the new directory, 'dirname' have the permissions of 0755 or 0777?mkdir("dirname", 0777) or die "could not create dir: $!";
If the code is...
...Will the system's default permission be changed from 0755 to 0777 due to these statements? (will subsequent directories created have permissions of 0777 or will the default still be 0755)?umask 022; mkdir("dirname", 0777) or die "could not create dir: $!";
What code do I use if I just want to create a directory with the system's default mode?
I hope this is clear. Most references I read are very vague on the use of 'umask'. I don't want to use it incorrectly and change the system's default. The hosting company may not appreciate it, so I need enough info (risks; proper use; when to use; etc.) before proceeding.
Thanks.
--newbie00
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Does changing 'unmask' change the system's default value?
by VSarkiss (Monsignor) on Dec 25, 2001 at 01:22 UTC | |
by newbie00 (Beadle) on Dec 25, 2001 at 01:41 UTC | |
by VSarkiss (Monsignor) on Dec 25, 2001 at 02:18 UTC | |
by newbie00 (Beadle) on Dec 25, 2001 at 02:41 UTC |