Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

(ichimunki) re: recursive perl chmod

by ichimunki (Priest)
on Mar 02, 2001 at 17:41 UTC ( #61788=note: print w/ replies, xml ) Need Help??


in reply to recursive perl chmod

Although this may not save you much here, you may want to look at Getopt::Std for grabbing command line options (maybe even Getopt::Long).

Also, if you are distributing a replacement for a unix system tool, you might want to be more verbose about what this does that it doesn't. Because when I hear "recursive chmod" I think chmod 755 cgi-bin --recursive. Added: of course, by looking at it, I see that it does a great job of taking different file types and chmod'ing them appropriately. Cool.


Comment on (ichimunki) re: recursive perl chmod
Download Code
Re: (ichimunki) re: recursive perl chmod
by howard40 (Beadle) on Mar 03, 2001 at 00:42 UTC
    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...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://61788]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-07-14 07:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (256 votes), past polls