CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
Used diskspace script?

 



Chef
Deleted

Mar 12, 2001, 2:12 AM

Post #1 of 2 (603 views)
Used diskspace script? Can't Post

Hi,

i'm looking for a simple script what shows the used diskspace of a directory including all subdirs - could be usable over browser or telnet.

Any ideas?





Kanji
User / Moderator

Mar 15, 2001, 9:24 PM

Post #2 of 2 (591 views)
Re: Used diskspace script? [In reply to] Can't Post


Code
perl -MFile::Find -le 'find( sub { $total += -s }, shift || "." ); print "$total bytes"'

... which will count everything from the current or -- if you give it an argument -- an arbitrary directory down. Changing it into a script instead of a one-liner is left as an exercise to the reader. :-)


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives