Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Are there canned fileserver grooming scripts?

by Gloom (Monk)
on Feb 01, 2001 at 21:55 UTC ( #55763=note: print w/replies, xml ) Need Help??


in reply to Are there canned fileserver grooming scripts?

This is a skeleton for implementing many filters on files in a directory.
Add your options and tests...
#!/usr/bin/perl -w use strict; my( $max_size , $min_size ); #parse args for(@ARGV) { if( /^--max_size=(.*)/ ) { $max_size = int( $1 ) } if( /^--min_size=(.*)/ ) { $min_size = int( $1 ) } } # end prints with \n $\ = "\n"; # open curent directory opendir( DIR , "." ); # test directories one by one. while( $_ = readdir( DIR ) ) { # drop "." and ".." next if /^\.\.?$/; # test for max length next if( $max_size and -s $_ > $max_size ); # test for min length next if( $min_size and -s $_ < $min_size ); print } # close... closedir( DIR );
Hope this helps :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2022-01-22 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (62 votes). Check out past polls.

    Notices?