http://qs321.pair.com?node_id=73763


in reply to checking file size

You might try the following on for size:
#!/usr/bin/perl use File::Find qw(find); kill_big_files( "/tmp", 300*1024 ); sub kill_big_files { my $dir = shift; my $size = shift; find( sub { # current file is in $_ # current dir is the directory $_ is in return if -d; # skip directories return if -l; # skip links return if $size > -s; print "removing $_\n"; unlink; }, $dir); }
File::Find is a very useful tool. Very fast for making utilities which recurse directories.

Replies are listed 'Best First'.
Re: Re: checking file size
by merlyn (Sage) on Apr 19, 2001 at 17:16 UTC