in reply to Chmod

btrott is right as usual, but also check what your umask is... If its set to the system's default (022) you'll neve get anything better than 755 on chmod. Have you tried doing:
umask(0000); chmod(0777,'whatever') or warn();
It might do the trick... You can't chmod above your umask limit.

#!/home/bbq/bin/perl
# Trust no1!

Replies are listed 'Best First'.
RE: RE: Chmod
by dffuller (Novice) on May 03, 2000 at 15:36 UTC
    Actually, the umask merely sets the default permissions. If you use chmod, you can set the permissions to anything you want (assuming you own the file).
      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!
        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