"Arching" google?  I can't even remember what I was trying to say.  Oh, well, that's 
what I get for CUI (coding under the influence).

-----Original Message-----
From: Tim Johnson 
Sent: Sunday, January 04, 2004 7:21 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Getting the total size of a directory


I think there was a very recent thread on this, but here's one way using File::Find, 
taking a little from a result I found by arching Google:
 
##################################
use File::Find;
use strict;
my $dir = $ARGV[0];
my $size;
find(sub{ -f and ( $size += -s ) }, $dir );
$size = sprintf("%.02f",$size / 1024 / 1024);
print "Directory '$dir' contains $size MB\n";
##################################

        -----Original Message----- 
        From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
        Sent: Sun 1/4/2004 6:10 PM 
        To: [EMAIL PROTECTED] 
        Cc: 
        Subject: Getting the total size of a directory
        
        

        I'm running out of web space and want to write a script that tell me the size
        of certain directories so I can see where the hog is.
        
        Can anyone give me some quick code?
        

Reply via email to