in reply to RE: RE: Chmod
in thread Chmod

You're absolutely right! My bad...

At first, when I read your post, I though, "This can't be right! I've been doing this for ages now!" And then I tested it:
johnny@chthon:~/tmp > mkdir foobar johnny@chthon:~/tmp > ls -l total 1 drwxr-xr-x 2 johnny users 1024 May 4 07:10 foobar johnny@chthon:~/tmp > perl -e 'umask(0666); chmod(0777,'foobar');' johnny@chthon:~/tmp > l total 4 drwxr-xr-x 3 johnny users 1024 May 4 07:10 ./ drwx------ 12 johnny users 2048 May 3 23:09 ../ drwxrwxrwx 2 johnny users 1024 May 4 07:10 foobar/ johnny@chthon:~/tmp >
'nough said! I've been doing it wrong for ages... Thanks!

Replies are listed 'Best First'.
Re: RE: RE: RE: Chmod
by IkomaAndy (Acolyte) on Jun 20, 2001 at 23:59 UTC
    Other things, such as mkdir, are affected by the umask:
    andy@okura:[/tmp/test] mkdir foobar andy@okura:[/tmp/test] ls -l total 4 drwxr-xr-x 2 andy andy 4096 Jun 20 14:55 foobar andy@okura:[/tmp/test] perl -e 'umask(0666); chmod(0777,'foobar'); \ > mkdir('foobar2',0777);' andy@okura:[/tmp/test] ls -l total 8 drwxrwxrwx 2 andy andy 4096 Jun 20 14:55 foobar d--x--x--x 2 andy andy 4096 Jun 20 14:55 foobar2