Octavian Rasnita wrote at Sat, 03 Aug 2002 15:43:46 +0200:

> Is there a Perl function, or a module that can find out the size of  a
> directory with all its files from all subdirectories?
> I know that I could use the system function to run a command line but I want
> to avoid this.

I don't know whether there's a module doing this job -
also I believe there should be one,
but you could also do it with File::Find.

use File::Find;

my $dirsize = 0;
find(sub {$dirsize += -s $_}, $directory);

print $dirsize;



Greetings,
Janek


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to