drop ole and use File::Find::Rule (a fine module, and platform independent!)
#!/usr/bin/perl use strict; use warnings; use File::Find::Rule (); die 'usage: dir_size.pl *directory*' unless 1 == @ARGV; my( $size, $files, $folders ); my $rule= File::Find::Rule->start( @ARGV ); while( my $item= $rule->match ) { next if $ARGV[0] eq $item; $size+= -s $item; -f $item and $files++; -d $item and $folders++; } printf "Size: %fMb (%d byte), Files: %d, folders: %d\n" => $size / 1024**2, $size, $files, $folders;
~Particle *accelerates*
In reply to Re: OLE dir size and number of files and folders
by particle
in thread OLE dir size and number of files and folders
by blackadder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |