DIRSIZE
=======

Copyright (c) 1993-1996 Simon A Carter

The Directory Size Lister with the Lot:

     *   Summary statistics for multi-level directories. This
         is very useful for finding the complete size of
         applications before deletion or backup.
     *   Support for Windows 95 long filenames.
     *   For the drive, displays cluster size, free space,
         used space and capacity.
     *   For the files examined, displays used space and
         wasted space.
     *   Rounds up file sizes to the cluster size for the
         most accurate size information.
     *   Future proof - directory sizes up to 99 GB are
         catered for.
     *   Output can be redirected to a file or to the
         printer.
     *   Continuous progress indicator.


This program is free for private or home use, but payment
is required for use by business, in government or
institutions. Please see the end of this file for more
information.


What will DirSize do for ME ?
=============================

DirSize shows a graphical tree of the directories on your
hard disk. The tree starts from the current directory, or
from the directory that you specify. The left column
displays the disk space used by each directory.
Directories that contain further sub-directories display
summary statistics in square brackets after the directory
name. This is very useful for determining the complete
size of an application, for example, if you were hunting
for an application to remove to make way for a new one.
Alternatively, DirSize can be used to find the total size
of an application before a backup or copy is made.

DirSize automatically detects and displays Windows 95
long filenames. Of course, it will still run under any
older version of DOS.


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

Just copy DIRSIZE.EXE to a directory in your path, for
example, to C:\DOS. To find out the directories in your
path, type

   c:\> path


How to use DirSize
==================

Usage:
   dirsize [/C<+|->] [initial path]

The initial path is optional - if you leave it out,
DirSize will start its display from the current
directory. Directory names with special characters such
as spaces can be entered normally i.e. quotes are not
required e.g.

   c:\> dirsize Program Files

When DirSize detects that its output is being redirected,
it automatically selects portable characters to draw
lines, such as +, - and |. It does this because the
output may be sent to a device that does not understand
DOS's line drawing characters. When DirSize's output goes
to the screen, it uses the DOS line drawing characters.
You can override the default behaviour in either case
using the optional /C parameter:

     /C+ forces DirSize to use DOS's graphical line
         drawing characters regardless of whether the
         output is being redirected or not.
     /C- forces DirSize to use portable text line
         drawing characters regardless of whether the
         output is being redirected or not.


Redirecting Output
------------------

DirSize's output can be redirected to any device. For
example, to save DirSize's output to the file output.txt,
you can type:

   c:\> dirsize > output.txt

To add DirSize output to an existing file exists.txt,
type

   c:\> dirsize >> exists.txt

To send DirSize's output to the printer, type

   c:\> dirsize > prn

To run DirSize on your entire D: drive, type

   c:\> dirsize d:\

To view a convenient page-by-page display of DirSize's
output, type

   c:\> dirsize | more


DirSize Example
---------------

The output below was generated from running DirSize in
the Program Files directory (in a DOS shell under Windows
95):

   c:\> dirsize Program Files
   
                0   C:\Program Files   [100,663,296]
        1,277,952   |--Accessories   [1,769,472]
          491,520   |  +--HyperTerminal
           32,768   |--Common Files   [16,842,752]
           32,768   |  +--Microsoft Shared   [16,809,984]
          622,592   |     |--Artgalry
          917,504   |     |--Equation
        2,031,616   |     |--Grphflt
          491,520   |     |--MSinfo
        1,572,864   |     |--MSquery
        2,359,296   |     |--Msgraph5
        1,736,704   |     |--Orgchart
        2,883,584   |     |--Proof
        2,031,616   |     |--Textconv
        1,409,024   |     |--VBA
          720,896   |     +--Wordart
          655,360   |--Font Assistant
        3,014,656   |--Games
           65,536   |--Help Assistant
        5,242,880   |--JOBINT
          786,432   |--LVIEWPRO
           65,536   |--Microsoft Exchange
        6,651,904   |--Norton AntiVirus   [7,208,960]
          557,056   |  +--System
        2,293,760   |--Norton Commander
                0   |  +--Indexing
        8,978,432   |--Norton Utilities   [14,942,208]
        5,963,776   |  +--System
       11,272,192   |--PAINTER3   [15,564,800]
          557,056   |  |--MOVIES
          589,824   |  |--NOZZLES
          720,896   |  |--SESSIONS
          819,200   |  |--SUPPLIES
        1,605,632   |  +--TUTORIAL
          688,128   |--Plus!   [2,392,064]
        1,179,648   |  |--Setup
          524,288   |  +--System
          262,144   |--Resource Kit
        1,736,704   |--Symantec
        1,212,416   |--The Microsoft Network
        1,802,240   |--Type twister
          688,128   |--UltraEdit
        2,129,920   |--VendInfo
        4,161,536   |--Visio   [20,414,464]
        2,719,744   |  |--Add-ons
          393,216   |  |--Drawings
        3,014,656   |  |--Help
                0   |  |--Stencils   [4,816,896]
        4,816,896   |  |  +--Standard
           98,304   |  |--System   [4,587,520]
          360,448   |  |  |--Custom
        2,162,688   |  |  |--Filter32
        1,277,952   |  |  |--Setup32
          688,128   |  |  +--Spelling
                0   |  +--Template   [720,896]
          458,752   |     |--Standard
          262,144   |     +--Wizards
        1,310,720   |--WinZip
          262,144   +--winhack
   
   Files examined:
        Used space:    100,663,296 bytes
      Wasted space:     15,760,275 bytes (15% of used)
   
   Drive C:
      Cluster size:         32,768 bytes
        Free space:     53,903,360 bytes (4% of capacity)
        Used space:  1,033,830,400 bytes
          Capacity:  1,087,733,760 bytes


Note how all sizes shown (except the wasted space) are
integral multiples of the drive's cluster size.


What is the "Cluster Size" ?
============================

When your computer places files on a disk (both hard
disks and floppy disks), it must use an integral number
of allocation units. The size of the allocation units
varies depending on the total capacity of the disk. This
means that if a file is smaller than one complete
allocation unit, it does not fill the entire allocation
unit. For example, lets say we have a file that is 300
bytes long. On a floppy disk with an allocation unit of
512 bytes, the file will only occupy the first 300 bytes,
but since one entire allocation unit must be used, the
remaining 212 bytes are wasted. A file 513 bytes long
will occupy 2 allocation units, with 511 bytes wasted. An
allocation unit is called a CLUSTER. Floppy drives
typically use a cluster size of 512 bytes or 1,024 bytes,
so not much space is wasted. Hard disks range from 2,048
bytes (for a 106 MB drive) to 32,768 bytes (for a 1.04 GB
drive) and even 65,535 bytes, which means that a great
deal of space is wasted. The cluster size gets bigger
with bigger disks for two reasons:

     1)   A DOS limitation that sets an absolute upper maximum
         on the total number of clusters on a drive.
     2)   The overhead of managing a large number of clusters
         consumes a lot of disk space that cannot be used for
         anything else.

The DOS DIR command always shows you the size actually in
use by the file.


Directories use up clusters too
-------------------------------

Each directory takes up a minimum of one cluster. To
reduce the amount of disk space used by directories,
remove directories that do not contain any files.


Lost clusters
-------------

Clusters can become orphaned when DOS is unable to
complete changes to the disk, for example, when you are
forced to reboot your machine or when the power is turned
off accidentally. These clusters cannot be used until
they are identified and reclaimed. Use the DOS CHKDSK
command to reclaim lost clusters. 


Reducing wasted space
=====================

What about Disk Compression ?
-----------------------------

Disk compression programs like Stacker and DoubleSpace
are able to make use of the wasted space because they
take on the responsibility of storing the files
themselves. By doing so, they overcome DOS's integral
cluster size limitation.


What about archives ?
---------------------

Storing collections of files in a compressed or
uncompressed archive saves space, because by grouping all
of the files into one large file, only a small amount of
space is wasted. The archive program uses its own format
to store the files without wasting space.


Partitions
----------

Partitions subdivide a physical disk drive into a number
of logical drives. For example, a 500 MB hard disk could
be partitioned into two 250MB partitions, C: and D:. The
advantage of doing this is that the cluster size can be
smaller, and hence the amount of wasted space will be
smaller. The disadvantage is that it takes time to set up
(since you have to move ALL of your data off the hard
disk in order to partition it), and you have to remember
which drive your programs are on, and manage space across
two drives instead of one. For more information on
partitions, see the DOS FDISK command.


Registration
============

Registration for business, government or institutional
use costs $AUS 20. This covers my costs of sending the
registered version to you.

For users outside Australia, please add $AUS 12 to cover
my bank's foreign cheque charge.

Please make cheques payable to Simon Carter.


Contact information
===================

I am always happy to hear your comments! If you use and
like DirSize, or have any suggestions for improvements,
please drop me a line!

email: sac@tusc.com.au
Voice/fax: +61-3 9729-8836

Crystal Software
14 Canterbury Road
Heathmont
Victoria 3135
AUSTRALIA
