@(#) README 1.15 93/08/18 00:08:57

"enh-du2" is a highly-portable, high-performance, POSIX-conformant
reimplementation of the "du" command.  It also adds some helpful
features your system "du" lacks.  If you find your current system "du"
buggy or unacceptably slow, or if you find some of the features in
this version appealing, you might want to try it.

This package includes, in addition to the enhanced "du" command, a
couple of handy utilities.  The "dusort" filter formats the output of
"du" nicely.  (Even if you aren't interested in the "du" program itself
check out this filter.)  The "ngsizes" script produces a summary of
disk space used by the usenet news system.  It puts some of the
"enh-du2" features to good use.


=== Contents =================================================================

	- Overview
	- Installation
	- Credits


=== Overview =================================================================

Word to the impatient:  Edit "Makefile" and "config.h", then run "make".

This version supercedes the "enh-du" published in comp.sources.misc
volume 14.  The update is not intended to provide an explosion of
chrome and bloat (aka "gratuitous features").  This release mainly
improves portability, especially in heterogeneous networked environments.

The original "enh-du" was written to address several problems.  There
were some things I couldn't do with the vendor-provided "du".  Sometimes,
for example, I wanted to see usage in 1K blocks instead of 512-byte
blocks, or I wanted to look at disk usage without accumulating
subdirectory usage into parent directories.  Moreover, I found that
many vendors shipped versions of "du" that were broken (most common
bug was incorrect indirect block overhead calculations) or sluggish.

I think the original release met those goals.  This version addresses
a couple of additional issues.  It is more portable.  It is more
reliable, particularly in networked environments where one or more
vendors don't do stat(2) correctly.  It should not be compatible with
Posix 1003.1.  Oh yeah, and it does add a few new features.

In the time since the original "enh-du" was released, many vendors
have gotten their act together, providing versions of "du" that fixed
the bugs and improved performance.  None the less, I've found that
"enh-du2" performs favorably with respect to every alternative I have
tried -- including both vendor supplied and freely available versions.
This means that if you use "enh-du2" for the added features, you should
not pay a performance penalty for that choice.

Two new features have been added to this release per the requests of
several people.  An "-L" switch has been added to average the usage of
multiply-linked files across all of the links.  A "-C" switch has
been added to display a file count in addition to the disk usage.

To give you a feel for what this program can do, here is the output
of "du -h".  Portions of this message are site dependant, and so your
mileage may vary.

du - version 2.0
    Copyright 1990-1993, Unicom Systems Development, Inc.  All rights reserved.
Usage:
    du [ options ] [ path ... ]
Options:
    -a          Report all entries, i.e. files as well as directories.
    -b          Equivalent to "-B 1".
    -B n        Report in blocks of "n" bytes (default 512).
                  (Use "0" to report in native filesystem blocks.)
    -c n,n,...  Breakdown by age, one col for each "n" days or older.
    -C          Display file counts as well as disk usage.
    -f          Do not cross any filesystem mount points.
    -F          Do not cross remote filesystem mount points.
    -h          Display this help message.
    -i          Do not accumulate subdirectory usages into parent dir.
    -k          Equivalent to "-B 1024".
    -l          Count multiply linked files each time encountered.
    -L          Average usage of multiply linked files across the links.
    -s          Only report a total for each argument on command line.
    -t          Report a grand total of all items.
    -u          Skip (do not count) multiply linked files entirely.
    -U user     Report only usage by given user (specify name or id num).


=== Installation =============================================================

enh-du2 is distributed ready to go for an SCO Unix 3.2v2 system.  If you
are using something else, you've got a bit of work to do.  Here are the
steps to bring up the package:

  - Customize the "config.h" file for your system.

  - Customize the definitions at the top of the "Makefile".

  - Run "make".

  - Try it.  If you like it run "make install".  You will, however,
    need to customize a bunch of definitions in the "Makefile" to
    tell the install to do what you want.

I have reports that "enh-du2" runs on the following systems:

	HP/9000 series 400	HP-UX 8.02
	HP/9000 series 800	HP-UX 8.02
	IBM RS/6000		AIX3.1
	NCR Tower		SysVr3.1 (NCR release 03.00.00)
	Sun SPARC		SunOS 4.1.2, Solaris 2.1
	AT&T 3B1		SysVr3.2 (ver 3.51m)
	AT&T 3B2		SysVr3.1
	386			AT&T SysV 3.2.2.3
	386			ISC SysVr3.2 versions 2.0.2, 2.2, 3.0.1
	386			MicroPort SysV 3.0U3.0e
	386			SCO Xenix 2.3.X
	386			SCO Unix 3.2v2, 3.2v4
	386			BSDI versions 0.9.2, 1.0

If you get stuck configuring "enh-du", some possibly helpful information
follows.  I'll show you the settings I used when testing the package on
various systems.

The following table shows the "config.h" settings.  The distributed
file is setup for SCO Unix 3.2v2.  A "-" in the table means the item
was not changed from the distributed setting.  "enab" means the
definition was enabled and "disab" means it was commented out.

	    distributed
	   configuration
		 |
		 |
		\|/
		SCO	SCP	SCO	ISC				AT&T 3B2
		Unix	Unix	Xenix	Unix	Solaris	SunOS	BSDI	and NCR
		3.2v2	3.2v4	2.3.4	2.2,3.0	2.1	4.1.2	1.0	Tower

USE_DIR_xxxx	DIRENT	-	-	-	-	-	-	-
USE_MOUNT_xxxx	MNTTAB	-	-	-	R4MNTTAB MNTENT	FSTAB	-
USE_STATFS_xxxx	SYSV	-	-	-	-	SUN	BSD	-
USE_SYMLINKS	disab	enab	-	-	enab	enab	enab	-
USE_STBLOCKS	disab	-	-	-	enab	enab	enab	-
BROKE_STBLOCKS	disab	-	-	-	-	-	-	-
USE_STDARG	enab	-	-	disab	-	disab	-	disab
USE_UNISTD	enab	-	-	-	-	-	-	-
USE_PATHCONF	enab	-	disab	disab	-	-	-	disab
PTRTYPE		void	-	-	char	-	-	-	char
REPORT_BLKSIZE	512	-	-	-	-	1024	-	-

Here are the CDEFS and LIBS settings I used in the "Makefile":

System				CDEFS =		LIBS =

SCO Unix 3.2v2, 3.2v4		(empty)		-lmalloc
SCO Xenix 2.3.4			(empty)		-lmalloc -ldir
ISC Unix 2.2, 3.0		(empty)		-lmalloc
Solaris 2.1			(empty)		-lmalloc
SunOS 4.1.2			(empty)		(empty)
BSDI 1.0			(empty)		(empty)
AT&T 3B2 and NCR Tower		-I.		-lmalloc


=== Credits ==================================================================


My thanks and gratitude to several folks.  Lars Henrik Mathiesen
<thorinn@diku.dk> provided a very nifty algorithm to figure out the
quanta for st_blocks.  Chip Salzenberg <chip@tct.com> enhanced the
portability greatly, and provided the AIX mount table handling code.
Bill Bunton <wgb@tnt.com> and Bill Kennedy <bill@ssbn.com> gave me
logins on a bunch of machines.

Additional thanks to the following folks for testing enh-du2 and
providing suggestions and fixes:

    Dave Ratcliffe <compnect!dave@uwm.edu>
    afc@shibaya.lonestar.ORG (Augustine Cano)
    bill@unixland.natick.ma.us (Bill Heiser)
    consult!bob@uunet.uu.net
    ole!rwing!pat@cs.washington.edu (Pat Myrto)
    pilikia.pegasus.com!art
    wht@n4hgf.Mt-Park.GA.US (Warren Tucker)
    wyman@atherton.com (Wyman Chong)
    clive@x.co.uk (Clive Feather)
    Kari Sutela <sutela@utu.fi>
    graaff@dutiws.TWI.TUDelft.NL (Hans de Graaff)

There were many others -- these names were culled from my email archives.
My apologies if I left your name of the list.

What I learned from this:  given a choice, I'd probably choose an HP
or IBM computer over a case of the clap, but I'd have to think about
it first.  (On the other hand, as one guy pointed out to me, they've
got a cure for the clap.)

This program is copyright 1990-1993, Unicom Systems Development, Inc.
All rights reserved.

You are granted a non-exclusive license to use, modify, copy, and
distribute this software subject to the following conditions.  You
must ensure all copyright notices and license notices remain intact
in the copies you use or distribute.  Any modifications, other than
those in the areas clearly reserved for site-specific modifications,
must be marked as such.  This software is provided "as is".  No
warranties have been expressed or implied.  Since this license was
provided to you at no charge, you must assume the entire risk and
liability for all use of this software.

Comments, suggestions, and bug reports are welcomed to the address below.

Chip Rosenthal
<chip@chinacat.Unicom.COM>

