                     _____________________________

                         Haywire Software (HSw)

                               presents


                          Z D U  -  release 2


                      (C)Copyright 1995-1998 HSw

      
                              Written by:

                             Andr Jonsson

                        haywire@fatalunity.com
                     _____________________________




                       Contents of this manual:

  
                           1. Disclaimer
                           2. Introduction
                           3. Requirements
                           4. Installation
                           5. Features
                           6. Syntax & usage
                           7. Known bugs & reports
                           8. Various
                           9. Development
                          10. Author
                          11. Background
                          12. Future ideas
                          13. History









1.  DISCLAIMER
	
    USE OF THIS PROGRAM IS AT YOUR OWN RISK!
    THE AUTHOR DOES NOT TAKE ANY RESPONSABILITY FOR ANY LOSS, 
    OR DAMAGE, OF NEITHER DATA, SOFTWARE NOR HARDWARE, FROM DIRECT OR INDIRECT
    USAGE OF THIS PROGRAM.


2.  INTRODUCTION

    Zdu is a little tool that can come in handy when cleaning up your hard-drive and 
    general disk information.
    The idea behind Zdu is to scan a path (one or more) and report the content therein, 
    how many directories, how many files and how much a specific directory allocates on
    the harddisk. 

    You may now think: "What about the windows 'properties' on a folder?".
    To cut it short, that feature simply sucks, and will decieve you reporting sometimes
    a completely wrong directory size. This is mainly because of the way the filesystem 
    works. Zdu determines the filesystem type and the minimum allocateable size on 
    (i.e. clustersize), and makes all size calculations according to this.

    There are several, somewhat, similar programs available on the net today, though none 
    of them, fills my needs, Also, most of them are like >150k in size, fancy graphical 
    interface and all that gibberish, which I do not need. Hence Zdu was born :-)


3.  REQUIREMENTS

    A computer.

    More specific: an IBM "compatible" PC.
	
    Even more specific:

        CPU: Pentium or higher
        MEM: about 1Mb (probably more depending on directory sizes hence stack-allocation)
        OS:  Windows 9x/NT(intel)
        Free disk space: ~40k
	
    And to put it to some good use a HD is recommended.

    At this time no Alpha version has been compiled, but if anyone need it donations
    are welcome! :-)


4.  INSTALLATION

    Copy the executable file to any directory, preferrably to one that you 
    have search-path to (it's more convienient that way).


5.  FEATURES

    Zdu's main feature is to scan a given directory and return the ammount of space that
    it allocates on disk. As default the directories in the directory specified will be
    accounted for separately, as a total size as well.
    Please note that Zdu returns the REAL size that the specified path really allocates 
    (for supported filesystems), as opposed to most programs that just returns all
    file-sizes added together (which basically is just crap).

    An optional filemask can be given to only return allocated size for *.ext files.

    A simple example of Zdu output when running it on my D drive:
    (in case you wonder, the 'turbo' directory is my Quake system :-)

    ---example begin---
        D:\>zdu

        Info drive D:[DH1] FS:FAT Cluster:32k
        Total: 1 081 540 608(1031M) Free: 183 435 264(174M)
          Dirs   Files        Usage(b)  Directory: *.*
        --------------------------------------------------------------
            79    1891     146 374 656  WIN95
             1       1          65 536  RECYCLED
             1       0          32 768  temp
            75     845      63 668 224  USR
           239    2363     460 029 952  turbo
            76     913      87 162 880  Program
            54     428     141 524 992  download
        --------------------------------------------------------------
           525    6442     898 891 776  .

        D:\>_
    ---example end---

    I think the example above pretty much speaks for itself.


6.  SYNTAX AND USAGE

    ZDU 2.0 has the following commandline syntax:

    Usage: ZDU <switches> path1[\filter1] pathN[\filterN]
    <switches>
      c        Report diskusage in clusters, instead of bytes
      d        Do not count directories as an allocated cluster (default for NTFS)
      f[N]     Fake clustersize to N bytes, must be a power of 2
      i        Do not print disk information
      k        Report diskusage in units of 1024 (also clusters)
      r        Print usage recursive
      q        "Quick" mode
      B        Print the Bytes column in the report
      D        Print the Dirs column in the report
      F        Print the Files column in the report
      I        Print disk info header
      P        Print the Path column (and filter) in the report
      s        Silent mode
    <filter>
               Any globbing pattern. i.e.: '*.gif' or 'haywire?.htm*'

    ---------------------------

    Switches:

      c       Report diskusage in clusters instead of bytes

              Reported sizes will be allocated clusters instead of allocated bytes, 
              sort of like UNIX' du command.

      d       Do not count directories as an allocated cluster

              This causes any directory to be excluded from the size calculation. This can
              be useful sometimes. I have yet to gotten my hands on any information about how 
              NTFS allocates directories(files), so this flag is default enabled if scanning NTFS
              disks (it will result in a more accurate total result).


      f[N]    Fake clustersize to N bytes
              Normally Zdu determines the clustersize of the scanned disk automatically.
              This can be overridden with this flag. This could be useful if comparing a
              directory on two different computers. The specified cluster size [N] will be 
              truncated to the nearest, lower, power of 2.

              This can be useful when comparing two directories on diffrent disks/computers.


      i       Do not print disk information  (renamed from 'S' in v2.0.2)
              Normally, ZDU prints various information about the disk being scanned, 
              such as size, free space etc. If this switch is set that information will
              not be printed.


      k       Report diskusage in kilo- bytes or clusters, similar to the "-k" switch on
              some versions of "du".


      q       "Quick" mode:
              If this switch is given Zdu will only return the total usage of the
              specified path plus the available info about the disk.


      r       Print recursively the usage. In a given directory tree, the innermost directory
              usage will be output first, then its parent, and then that directory's parent,
              and so on. It takes a bit of getting used to, to understand what the output means.


      s       Silent mode. Will only print the resulting line, i.e. the total usage
              of the scanned path. Implies both /s and /i.

      D F B P I
              Modifies the output format from Zdu. By default Zdu will output Dirs, Files, Bytes
              and Path columns. If any of these are specified  the format will reset and set only
              those columns. I.e. supply only /F and Zdu will only output the number of files, 
              not directories, nor the bytes and Path columns. To get the Normal format you must 
              supply all of them, which would result in the same as not supplying them at all.


    NOTE: The switches are now CASE-sensitive.

    Filter:

      From beta7 and on, ZDU uses a normal globbing string matcher method. Therefore any valid 
      glob-pattern is viable, for example:

        *.txt     : filenames ending with ".txt"
        *one*     : filenames that contains "one"
        file?.txt : files with names like "files,txt", "file1.txt" etc.


7.  KNOWN BUGS/FLAWS & REPORTS

    - Really large FAT32 partitions(above 7 Gb), under Win98 (perhaps 95 also) reports wrong 
      size & free numbers.

    - NTFS directories are not handled correctly, but in large should give an correct result.

    - NTFS multiple streams are not accounted for when calculating sizes.

    - Switches on the commandline can not be grouped (i.e. '/kc' must be typed as '/k /c').

    If you have found any bugs please e-mail me immediately, I might not have found it yet 8)
    Or if you just like to give me some suggestion, or maybe give me some flames?


8.  VARIOUS

    During development of Zdu the following music was listened to: (in no particular order)

      Helloween: Better Than Raw
      ZZ-Top: The very best of
      Meshugga: Destroy Erase Improve
      Anthrax: The threat is real
      Anthrax: Attack of the killer B's
      Sugar Ray: Lemonade and Brownies
      Pantera: The great southern trendkill
      Enya: The celts
      Rammstein: Sehnsucht
      Rage Against the Machine: Evil Empire
      2 Unlimited: Hits unlimited

    And, mind you, these are no mp3 crap, it's the real deal, well... CD anyway.


9.  DEVELOPMENT

    Info     : C-source     : ~25 kbytes (in ~1050 rows)
               Exe-file     : ~44 kbytes
               Compile time : ~3 sec

    Software : Windows NT 4.0
               MS Visual C++ 5.0 & 6.0

    Hardware : PII-400 128Mb

    Docs     : Notepad      (accept no limitations!)
                


10. AUTHOR

    This program was written by Andr Jonsson. I'm from Skellefte, Sweden.
    Visit my homepage at: http://haywire.fatalunity.com
    All new revisions of my programs will be downloadable from there (after following
    a link). At present only Zdu is available for download. Though I have previously
    released a program called Zap (a DOS program), which is publically available on 
    SimTel mirrors, and elsewhere. Download it will ya!
    (the archive is called AJZAP266.ZIP)

    Initial programming started way back in early 1995, because at the time there 
    were no diskusage programs at all available for the DOS "platform".
    As for release 2, the programming of the Win32 next-generation reincarnation began in the
    beginning of 1998, for unknown reason :-)

    e-mail: haywire@fatalunity.com        (no, it's not clickable)
    


11. SPECIAL THANKS

    Thanks goes to the following:

	- Data Ductus AB       Employer
      - Andreas Wiklund      Feature suggestions, critic, (beta)tester and 
                             additional programming


12. FUTURE IDEAS

    What ZDU will hopefully do in the near future:

    - Proper NTFS handling (maybe even multiple streams, if possible).
    - Make it possible to report on a basis of a specified user/group (NTFS only).
    - List usage based on "file types" (extensions).
    - Suggestions? Mail me! andre.jonsson@dataductus.se
    

    What ZDU will NOT do/have:

    - Have a GUI (there are so many (bad) GUIs already).


13. PROGRAM HISTORY

    ** Section moved to CHANGELOG.TXT


-----------------------------------------------------------------------------


  Laws of Computer Programming:

    (1) Any given program, when running, is obsolete.
    (2) Any given program costs more and takes longer.
    (3) If a program is useful, it will have to be changed.
    (4) If a program is useless, it will have to be documented.
    (5) Any given program will expand to fill all available memory.
    (6) The value of a program is porportional to the
        weight of its output.
    (7) Program complexity grows until it exceeds the capability of the
        programmer who must maintain it.
    (8) Make it possible for programmers to write in English and you
        will find the programmers cannot write in English.




                                  DON'T PANIC


Wow! You read to down here! If you meet someone else who managed to do the same,
you better start a club, you are some rare people. :-)