in reply to Dir size

You can try using Win32::File instead of File::Find, for starters. Otherwise, windows being windows, if you want to know what size IT thinks a directory is, might as well ask it:
$temp = `Dir $your_directory_here`; if($temp =~ m/(\s+)(\d+)( File)(\S{3})(\s+)(\S+)( bytes)/i){ print "$6 bytes\n"; }
That's some ugly code. Works though, least in XP. YMMV, and it won't give you sizes on subdirectories. The regex is a bit more brittle than I'd like...It'd be cleaner if you ripped all the /'s and ,'s out of the directory output first. Then you'd probably be safe just doing:
... if($temp =~ m/(\s+)(\d+)( bytes)/i){ ...

Replies are listed 'Best First'.
Re^2: Dir size
by satanicpuppy (Novice) on Mar 05, 2009 at 23:06 UTC
    if you use "Dir /-C" it'll drop the commas.