DIRSIZE v2.5
============

Copyright 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.
    *  Shows wasted space for a given cluster size.
    *  Rounds up file sizes to the cluster size for the most
       accurate size information.
    *  Paginates output, [Enter] for next line, [Esc] to exit and
       any other key for next page. Disabled automatically if
       output is redirected.
    *  Output can be redirected to a file or to the printer.
    *  The characters used to draw the directory tree can be
       changed from DOS extended ASCII characters to standard
       ASCII characters.
    *  Directory sorting can be disabled.
    *  Future proof - directory sizes up to 99 GB are catered for.
    *  Continuous progress indicator while accumulating file
       information.


PRIVATE use of DirSize is FREE. Please register your usage by
sending email to Simon Carter at launch@ozemail.com.au, with your
name and address.

Paid registration (costing $AUS 10) is required for use in a
business, commercial, government or institutional environment.
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    [Enter]


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

Typing

   dirsize /?   [Enter]

on its own will display usage information.

Usage:
   dirsize [/c<+|->] [/nosort] [/p] [/size=#] [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 without quotes
e.g.

   c:\> dirsize Program Files    [Enter]

When DirSize detects that its output is being redirected, it
automatically turns off pagination, and selects portable
characters to draw lines, such as +, - and |. It does this because
the output may be sent to a device or another computer that does
not understand DOS's line drawing characters (which are non-
portable). 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 /c option:

   /c+   forces DirSize to use DOS's graphical line drawing
         characters even if it detects that its output is being
         redirected.
   /c-   forces DirSize to use portable text line drawing
         characters even if it detects that its output is not
         being redirected. This is useful if the result is going
         to be used on another computer, for example, on a Unix
         machine or a Macintosh.

The /nosort option forces DirSize to not sort directory names into
alphabetical order (the default). This may be useful if you are
comparing DirSizes output to an unsorted listing from the DOS DIR
command.

The /p option tells DirSize to NOT paginate the output. Pagination
pauses after each screenful of output. [Enter] shows the next
line, [Esc] exits, [End] scrolls continuously to the end of the
output, and any other key shows the next screenful of output.
Pagination is automatically disabled when the output is
redirected.

The /size=# option tells DirSize to show how much disk space would
be wasted if the cluster size was set to # bytes per cluster. # is
restricted by DOS to powers of two, but for convenience DirSize
allows it to be set to any value. This is useful for previewing
the result of a change in cluster size on a set of files. In
general, the smaller the cluster size, the smaller the wasted
space.


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:

   dirsize > output.txt    [Enter]

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

   dirsize >> exists.txt    [Enter]

To send DirSize's output to the printer, type

   dirsize > prn    [Enter]


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    [Enter]
   
                0   C:\Program files   [113,082,368]
        1,277,952   |--Accessories   [1,769,472]
          491,520   |  +--HyperTerminal
                0   |--Common Files   [16,121,856]
                0   |  +--Microsoft Shared   [16,121,856]
          557,056   |     |--Artgalry
          819,200   |     |--Equation
        1,998,848   |     |--Grphflt
        2,260,992   |     |--Msgraph5
          458,752   |     |--MSinfo
        1,540,096   |     |--MSquery
        1,671,168   |     |--Orgchart
        2,850,816   |     |--Proof
        1,998,848   |     |--Textconv
        1,376,256   |     |--VBA
          589,824   |     +--Wordart
          655,360   |--Font Assistant
        3,014,656   |--Games
           65,536   |--Help Assistant
        5,242,880   |--JOBINT
          851,968   |--Launch
          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
          655,360   |--Plus!   [2,293,760]
        1,146,880   |  |--Setup
          491,520   |  +--System
          262,144   |--Resource Kit
        5,570,560   |--RESUMEW   [9,895,936]
          753,664   |  |--LETTERS   [1,015,808]
          262,144   |  |  +--MRG_LET
        3,309,568   |  +--RESUMES
        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,381,696]
        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,554,752]
          360,448   |  |  |--Custom
        2,129,920   |  |  |--Filter32
        1,277,952   |  |  |--Setup32
          688,128   |  |  +--Spelling
                0   |  +--Template   [720,896]
          458,752   |     |--Standard
          262,144   |     +--Wizards
          262,144   |--winhack
        2,523,136   |--WINRES
        1,310,720   +--WinZip
   
   Files examined:
        Used space:    113,082,368 bytes
      Wasted space:     19,348,332 bytes (17% of used)
   
   Drive C:
      Cluster size:         32,768 bytes
        Free space:    139,886,592 bytes (12% of capacity)
        Used space:    947,847,168 bytes
          Capacity:  1,087,733,760 bytes


Note how all sizes shown (except the wasted space) are integral
(whole) 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 (65535).
   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 - it does not include the extra 'wasted' space at the end
of the cluster. This wasted space is sometimes referred to as
'slack' space.


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. Lost clusters
are considered to be used.


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 - decreasing the cluster size
----------------------------------------

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 in
general, 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,
unless you have a program that can re-partition on the fly), 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.


Release Information
===================

Date         Version   Changes Made
24-June-96   2.5       Reduced stack usage further.
                       Added /nosort, /size=# and /p option.
                       Added automatic pagination.
                       Fixed bug for paths longer than 68
                       characters.
                       Re-instated stack checking.
13-June-96   2.4       Increased stack limit to 64K, and reduced
                       stack usage. This means that you can list
                       directories that are much deeper than
                       before. Appreciably faster (11 seconds
                       compared to 14 for a complete display of a
                       1.1 Gb drive).
                       Now only shows usage information if /?, ?
                       or -h given as first parameter.
                       Email and address changes.
27-May-96    2.3       Documentation update.
8-May-96     2.2       Shows usage information if no parameters
                       are provided.
                       Fixed bug in long filename functions that
                       prevented them from working under some
                       circumstances.
                       Fixed bug in file size rounding up
                       function, which made files that were an
                       integral number of clusters long one extra
                       cluster long.
                       Documentation update.
28-April-96  2.1       First release.
3-July-93    1.0       First created and used.


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

PRIVATE use of DirSize is FREE. Please register your usage of
DirSize by sending email to launch@ozemail.com.au, with your name
and address, and any relevant comments.

Paid registration (costing $10) is required for use in a business,
commercial, government or institutional environment.

Order form
----------


    Personal details
    ----------------
    
           Name: ____________________________________________
        Company: ____________________________________________
        Address: ____________________________________________
                 ____________________________________________
                 ____________________________________________
                 ____________________________________________
          Phone: ____________________________________________
            Fax: ____________________________________________


    For Visa, MasterCard or Bank Card (*)
    -------------------------------------
    (Sorry, I currently do not accept American Express)
    
    Card Number: ____ ____ ____ ____
    Expiry Date: ____/______
    
    
      Signature: ________________________________
    
           Date: ____________
    
    (*) Please note that these orders are processed by Omnivision
    Technologies, a licensed distributor.
    
    
    Cheques
    -------
    I accept bank cheques and personal cheques drawn on an
    Australian bank. Foreign cheques cost me an additional $AUS 12
    to cover my bank's foreign cheque charge. Please make cheques
    payable to Simon Carter.
    
    
    Postal money orders
    -------------------
    I accept prepaid postal money orders in Australian dollars.


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:  launch@ozemail.com.au
    WWW:  Checkout the Crystal Software home page at
          http://www.ozemail.com.au/~launch
    Fax:  +61-3 9800-3078  Any time.
  Voice:  +61-3 9729-8836  After hours number. Please leave a
          contact name, number and time, and I will try to get
          back to you within 24 hours.
   Mail:  Simon Carter
          Crystal Software
          2 / 9 Woodbine Court
          Wantirna
          Victoria 3152
          AUSTRALIA.
    
