in reply to mkpath()

Check what umask is set to and change it if necessary.

--perlplexer

Replies are listed 'Best First'.
Re: Re: mkpath()
by Anonymous Monk on Apr 17, 2003 at 14:28 UTC

    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

      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 ;)