Path: uunet!husc6!think!ames!necntc!ncoast!allbery
From: drw@culdev1.UUCP (Dale Worley)
Newsgroups: comp.sources.misc
Subject: Prettyprint a du listing
Message-ID: <6803@ncoast.UUCP>
Date: 17 Dec 87 02:33:54 GMT
Sender: allbery@ncoast.UUCP
Organization: Cullinet Software, Westwood, MA, USA
Lines: 447
Approved: allbery@ncoast.UUCP
X-Archive: comp.sources.misc/8712/8

I've always wanted to get a du listing that shows how the space is
being used graphically.  I finally wrote a program to digest a du
listing and print out a tree, where each directory occupies lines
proportionally to how much space the files in it consume.

To run it, type "du | dugraph" or some such.  The listing for each
directory starts with a blank space showing space occupied by files
directly in that directory, then the subtrees for each subdirectory
(in descending order of size).  If the subdirectories at the bottom
get so small that they occupy less than 1 line each, they are all
merged into an entry "(etc.)".

The entire listing always occupies 60 lines (the value of 'length').
This program has tab-width = 5.
--------------------------dugraph.c---------------------------------

