in reply to Does changing 'umask' change the system's default value?

First, it's not "unmask", it's umask (no N). You can read more about the Perl version here.

As to your direct question, the umask is set on a per-process basis. There's no "system umask", only what is set by your administrator in user startup files. If you set the umask, it will affect all files (and hence directories) created after that point by that process. In systems I know, the umask is inherited by child processes, but I'm not sure if that's true of all Unix-oid systems or not. It's certainly not true of Win32 systems, and I can't really speak to how it's implemented there.

HTH

Replies are listed 'Best First'.
Re: Re: Does changing 'umask' change the system's default value?
by newbie00 (Beadle) on Dec 25, 2001 at 01:41 UTC
    Hello and thanks for your reply. I am referring to a UNIX box.

    I'm not sure why I have 'uNmask' stuck in my head but I did mean 'umask'.

    Question: What do you mean by 'per-process basis'? I want to be real sure how long the changing of 'umask' will last.

    Is 'per-process' a session (duration of the script -- for all directories and files created until the script ends) or is it 'permanent' until it is changed again OR am I changing the value that the admininstrator set for my hosting account?

    Thanx.
    --newbie00

      Per-process means a single invocation of a program (or script). In other words, once you change it, it will affect files created after that point by that program, and (possibly) child processes created by that program. It will not affect any other programs or users, nor will it be remembered after the program ends.

      HTH

        Thanks again for your reply.

        Will the directory be created with the mode that is specified in 'mkdir' or must 'umask' be included first? I guess what I am also asking is, should 'umask' be used when its value is to be different in the 'mode' of 'mkdir' or can the 'mode' in 'mkdir' standalone and control the directory's permission without 'umask' being explicitly set?

        Again, thank you.
        --newbie00