Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

krellis (2720)

krellis
  reversethis-{gro.sillerk} {ta} {mit}
http://www.krellis.org/
AOL IM: KrellisOffice (Add Buddy, Send Message)

Perl geek, FreeBSD sysadmin, DNS know-it-all

Journal of krellis (2720)

Thursday February 07, 2002
06:05 PM

Yay Perl

[ #2708 ]

And now for my Perl success story of the day... found out today that our NetApp/Samba server had been conspiring to cause piles of directories in our web docs tree to be created with 0777 file modes. Ouch! Find tells me that there are, in fact, over 14,000 of these directories. All with twisty little exceptions to the simple thought of "oh, I'll just chmod them". Argh.

Luckily, File::Find and File::spec came to the rescue! With this combination, I was able to come up with a nice little function that does what I need it to do with the files - and it'll be really handy for some other things I've been putting off, too. One of those times that I really love Perl. No nasty manually chmod'ing 14,000 directories any more! :)

And I don't think I'm ever going to use "real" find again, either - File::Find just gives me soooo much more flexibility, and means I don't have to read the stupid find manpage to figure out what I want. Just plug in the right conditions in a function, give File::Find::find() a reference to it, and wham!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.