in reply to Dir size
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:$temp = `Dir $your_directory_here`; if($temp =~ m/(\s+)(\d+)( File)(\S{3})(\s+)(\S+)( bytes)/i){ print "$6 bytes\n"; }
... 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 |