in reply to (ichimunki) re: recursive perl chmod
in thread recursive perl chmod

i didnt use GetOpt, becuase i only have a few command line options to read in and didnt really see the need for using a separate module to do what i could do in ~8 lines of perl code... if i add anymore options in the future, i'll probably end up using GetOpt.

i dont intend this to be a replacement for unix 'chmod' either, but rather a tool to enhance the functionality of chmod, by allowing a bit more control over what gets chmodded. it allows the user to chmod an arbitrary number of files to an arbitrary number of modes all at one time (instead of chmodding all directories to 755, then chmod 644 -R *, then chmod 755 *.pl *.sh *.cgi, etc... everytime a directory tree needs to have permissions set)

the biggest difference between (pchmod.pl -r) and (chmod {mode} -R *) is that this will differentiate between files of certain types and directories, rather than mindlessly chmod *everything* in the tree to one mode. all hell breaks loose here when someone accidentally chmod's a directory on the webserver to 644 and apache spews out Forbidden errors... :)

it's also good for people that have a hard time remembering the syntax for chmod or aren't too familiar with linux... you can just add the necessary options into the %cfg hash and tell the person to type (pchmod -csomeconfig) and it'll set things the way you specified in the %cfg hash, instead of the person remembering the octal codes and such...
  • Comment on Re: (ichimunki) re: recursive perl chmod