in reply to chmod in perl script
my $filename = 'filename'; my $perms = ((stat($filename))[2] & 07777); # Just permissions, not + type my $newperms = $perms ^ 02000; # Add the group sticky +bit chmod $newperms, $filename or die "Could not change permissions: $!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: chmod in perl script
by mcleary (Initiate) on Feb 08, 2011 at 19:09 UTC |