in reply to Re: Re: Disk Space used by a folder (and sub folders)
in thread Disk Space used by a folder (and sub folders)
hm, doesn't stat function exist on win32? :))
#!/usr/bin/perl -w use strict; use File::Find; print "Total: ", GetFolderSize( defined $ARGV[0]?$ARGV[0]:'.'), $/; sub GetFolderSize { local $% = 0; find( { wanted => sub { local ($-,$=) = (-s,(stat)[11]); $%+=(int($-/$=)+($-%$=?1:0))*$= }},shift);$% }
--
AltBlue.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Disk Space used by a folder (and sub folders)
by $code or die (Deacon) on Jan 27, 2001 at 07:03 UTC | |
by AltBlue (Chaplain) on Jan 27, 2001 at 15:56 UTC | |
by tye (Sage) on Jan 28, 2001 at 05:05 UTC |
In Section
Cool Uses for Perl