Re: Directory Size

2010-10-28 Thread John W. Krahn
'/path/to/some/directory'; sub determine_size { if ( -f $File::Find::name ) { $size += ( stat $File::Find::name )[7]; } } You don't have to stat the same file twice: sub determine_size { if ( -f ) { $size += -s _; } } find( \&determine_size, $

Re: Directory Size

2010-10-28 Thread Alan Haggai Alavi
-f $File::Find::name ) { $size += ( stat $File::Find::name )[7]; } } find( \&determine_size, $directory ); $size /= 1024 * 1024; print "Total size: $size MB\n"; =cut Relevant documents to read: `perldoc File::Find` - http://perldoc.perl.org/File/Find.html `perldoc -f stat`

Re: Directory Size

2010-10-27 Thread Mike Blezien
- Original Message - From: "Alan Haggai Alavi" To: ; "Mike Blezien" Sent: Wednesday, October 27, 2010 8:13 PM Subject: Re: Directory Size On Thursday 28 Oct 2010 06:30:01 Mike Blezien wrote: Hello, I've been out of the programming game for a while and re

Re: Directory Size

2010-10-27 Thread Mike Blezien
- Original Message - From: "Owen" To: "Mike Blezien" Cc: "Perl List" Sent: Wednesday, October 27, 2010 8:17 PM Subject: Re: Directory Size Hello, I've been out of the programming game for a while and recently got back into some small programmin

Re: Directory Size

2010-10-27 Thread Owen
> Hello, > > I've been out of the programming game for a while and recently got > back into > some small programming projects. Just need to figure out if there is a > Perl > function to determine the total size of a folder and files? Meaning > once we > open/read a directory is to calculate the tot

Directory Size

2010-10-27 Thread Mike Blezien
Hello, I've been out of the programming game for a while and recently got back into some small programming projects. Just need to figure out if there is a Perl function to determine the total size of a folder and files? Meaning once we open/read a directory is to calculate the total, in MB's,

Re: Directory Size

2005-08-28 Thread John W. Krahn
Nick wrote: > Hi All, Hello, > Is there a way to get an entire directory and all sub-files/folders size > in Perl? Basicly, I need the Perl version of "du -s". http://ppt.perl.org/commands/du/index.html John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

Re: Directory Size

2005-08-28 Thread Owen
On Sun, 28 Aug 2005 18:25:43 +0100 Nick <[EMAIL PROTECTED]> wrote: > Hi All, > > Is there a way to get an entire directory and all sub-files/folders size > in Perl? Basicly, I need the Perl version of "du -s". > > I've currently done it with stat but

RE: Directory Size

2005-08-28 Thread Jim
> -Original Message- > From: Nick [mailto:[EMAIL PROTECTED] > Sent: Sunday, August 28, 2005 1:26 PM > To: Perl Beginners > Subject: Directory Size > > Hi All, > > Is there a way to get an entire directory and all > sub-files/folders size in Perl? Basic

Directory Size

2005-08-28 Thread Nick
Hi All, Is there a way to get an entire directory and all sub-files/folders size in Perl? Basicly, I need the Perl version of "du -s". I've currently done it with stat but this only gives a directory size not taking into consideration everything inside it. Nick -- To unsu

RE: Maybe OFF Topic - FTP Directory Size

2003-06-16 Thread Tim Johnson
You can do this with Net::FTP, but you'll have to write your own recursive subroutine to get the subfolders... -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2003 8:09 AM To: [EMAIL PROTECTED] Subject: Maybe OFF Topic - FTP Directory Size

Maybe OFF Topic - FTP Directory Size

2003-06-16 Thread Paul Kraus
Is their any Linux tools I can use to attach to an ftp site. Go to a folder and then get the file size of everything in or beneath the selected folder? If I can do this perl even better. If not any point in the right direction would useful. Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: getting directory size

2002-08-16 Thread Steve Grazzini
Dan Cox <[EMAIL PROTECTED]> wrote: > How do you get a directory's size? -s $dir; But if you want disk usage, count blocks instead of bytes and use File::Find to recurse. use File::Find; my $BLOCK_SIZE = 512; my $total = 0; sub wanted { $total += (lstat)[12]*$BLOCK_S

getting directory size

2002-08-16 Thread Dan Cox
How do you get a directory's size? Thanks for the help. Dan Cox -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]