in reply to Using stat() to get the total size of files in a folder
How about:
use File::Find; my $size = 0; find(sub { $size += -s if -f $_ }, "foo");
That will recurse down into subdirectories. If that's not what you want, you could use:
use File::Find; my $size = 0; find(sub { $size += -s if $File::Find::name eq "foo/$_" and -f $_}, "f +oo");
-sam
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Using stat()
by neilwatson (Priest) on May 24, 2002 at 13:34 UTC | |
by joshua (Pilgrim) on May 29, 2002 at 17:24 UTC |
In Section
Seekers of Perl Wisdom