![]() |
|
good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: drive space script dies on certain characters...by legato (Monk) |
on Jan 18, 2005 at 17:30 UTC ( #423103=note: print w/replies, xml ) | Need Help?? |
Well, this isn't much of a Perl script -- it's mostly a Perl wrapper around a shell command. That might be OK, but as you're finding out, it has limitations. You can either try to anticipate any strangeness (and changes) in the shell output, or you can eliminate the shell altogether by using File::Find. I wrote this little tool that lists the top $ARGV[0] largest files found at or below the current directory. This was written for Windows, so it doesn't do symlink exclusion (you'll want to add that, or symlinks will be reported as large files), and I haven't bothered to do "pretty-printing" of directory sizes in KB/MB -- all sizes are in bytes. This is by no means fantastic code, but it works; and, with a touch of mod, it will work the way you want it to:
Anima Legato
In Section
Seekers of Perl Wisdom
|
|