in reply to Re: mkpath()
in thread mkpath()

umask() returns 63

But why do I have to set an umask, if I give a mode? I don't have to set a special umask if I use "mkdir -m 1777" on the shell.

Thanks, Thom

Replies are listed 'Best First'.
Re: Re: Re: mkpath()
by perlplexer (Hermit) on Apr 17, 2003 at 14:55 UTC
    From 'perldoc -f umask':

    "permission (or "mode") values you pass mkdir or sysopen are modified by your umask, so even if you tell sysopen to create a file with permissions 0777, if your umask is 0022 then the file will actually be created with permissions 0755"

    So, unless mkpath() does some trickery with umask() by itself, the mode that you pass to mkpath() will be affected by current value of umask().

    And make sure you prepend the mode with '0', as Improv++ already mentioned.

    --perlplexer

      Thanks, no I understand ;)