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
In reply to Re: Using stat()
by samtregar
in thread Using stat() to get the total size of files in a folder
by joshua
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |