                     _____________________________

                         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>
      s        Short/Silent-list format
      S        Do not print disk information
      f[N]     Fake clustersize to N bytes, must be a power of 2
      k        Report diskusage in units of 1024 (also clusters)
      c        Report diskusage in clusters, instead of bytes
      d        Do not count directories as an allocated cluster (default for NTFS)
      u<user>  Report diskusage of specified <user> only *not implemented*
      g<user>  Report diskusage of specified <group> only *not implemented*

    <filter>
     *.<ext>   Wildstar plus extension. ie: '*.gif'


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

    Switches:

      s       Short/Silent-list format:

              If this switch is given Zdu will only return the _total_ usage of the
              specified path, similar to the "-s" switch of "du".

      S       Do not print disk information

              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.

      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.


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


      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).


    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

    - 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

    Nothing cool to write here, yet.


9.  DEVELOPMENT

    Info     : C-source     : ~17 kbytes (in ~750 rows)
               Exe-file     : ~40 kbytes
               Compile time : ~2 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: andre.jonsson@dataductus.se        (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 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
