in reply to Re: Need help with script to create directories
in thread Need help with script to create directories

Its funny! I had asked someone else and they said that the permissions in the 'mkdir' command were the umask, not what you wanted them to be set to, but now, seeing how it has worked, it makes perfect sense.

**a little later** Ok, I tried what was suggested and made the permissions in the mkdir commands 0775 to reflect the permissions I want and we have different results. The directories in the archive directory were created, but the permissions are not correct. The directory /home/jlk/tmp/data/stuff/archive/testing has permissions of 744 instead of 775. I am stumped as to what happened there. The directories inside of the testing directory were created and with the same permissions, 744, instead of 755. The log files were also created, but with permissions of 644 instead of 666. Am I doing something wrong with permissions?

Regards,
jlk

Seasame street was brought to you today by the letters M, I and T and the number 3.1415926535897932384626433832795

  • Comment on Re^2: Need help with script to create directories

Replies are listed 'Best First'.
Re^3: Need help with script to create directories
by dakkar (Hermit) on Jun 21, 2004 at 08:08 UTC

    From perldoc -f mkdir:

    mkdir FILENAME,MASK
       Creates the directory specified by FILENAME, with permissions
       specified by MASK (as modified by "umask").
    

    This means that, even if you specify 0777 as MASK, the actual permissions of the directory will be 0777 & umask. You can set the umask with the function of the same name in Perl or in the shell.

    -- 
            dakkar - Mobilis in mobile
    

    Most of my code is tested...

    Perl is strongly typed, it just has very few types (Dan)