Haywire Software (HSw)

presents

Z D U - release 2

(C)Copyright 1995-1999 Haywire Software

Written by:

André Jonsson <haywire@fatalunity.com>

Contents:

1. DISCLAIMER
2. INTRODUCTION
3. REQUIREMENTS
4. INSTALLATION
5. FEATURES
6. SYNTAX & USAGE
7. KNOWN BUGS & REPORTS
8. FUTURE IDEAS
9. DEVELOPMENT
10. AUTHOR
11. VARIOUS
12. SPECIAL THANKS
13. HISTORY
 
 
 
 

1. DISCLAIMER

THIS PROGRAM IS DELIVERED "AS IS" AND ANY USE OF THIS PROGRAM IS AT YOUR OWN RISK! THE AUTHOR (OR THE SUPPORTING AUTHOR(S)) DOES NOT TAKE ANY RESPONSABILITY FOR ANY LOSS, OR DAMAGE (PHYSICAL OR MENTAL), 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 selecting 'properties' on a folder in windows?". To cut it short, that feature simply sucks, and will decieve you by 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 R2 was born :-)

And from v2.4 Zdu has broadend its views, by sporting a new smashing graphical user interface (GUI)!

3. REQUIREMENTS

A computer.

More specific: an IBM "compatible" PC.

Even more specific:

CPU: Pentium or higher
MEM: ~1Mb (GUI version ~2Mb) - this depends on the directoryscanned
OS: Windows 9x/NT/2000(Intel)
Free disk space: ~140k (including zip file and installed)

And to put it to some good use a harddisk is recommended.

At this time no NT-Alpha version has been compiled because I don't have access to any Alpha with NT, but if anyone need an Alpha version donations are welcome! :-)

Memory requirements could probably be more, but it seldom uses more than just over 700k. Infact, on my E: drive (now consisting of 28000 files in 2000 dirs with a tree depth of 11) it takes 760k memory (+300k virtual).

And if you think zdu is slow, get a new HD, because over 90% of the CPU power (on my machine) is system time (i.e. disk activity), and Zdu is designed to be streamlined, it always do as little as possible.

4. INSTALLATION

Copy the preferred executable file to any directory, preferrably to one that you  have search-path to (it's more convienient that way). Ofcourse you may copy both of the executables if you wish.
The executables can ofcourse be renamed, e.g. rename the 'zdugui.exe' to 'zdu.exe' is fine. The two executables are standalone, and do not need the other to operate.

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 certain files.

A simple example of Zdu output when running it on my E: drive:

E:\>zdu /h
E: "DATA" 3760:353D - FS:FAT32 - Cluster:8k
Total: 15 711 338 496 [14G] - Free: 9 292 300 288 [8G]
 Usage(B)   Dirs   Files  Eff  Path
--------------------------------------------------------------
     749M    206    4425  97%  download
      14M     33     207  92%  RECYCLED
     262M    767   11421  77%  data
     502M      0      11  99%  BeOS
     680k      7      11  91%  temp
     6.9M      2      51  97%  usr
     3.5G    347    6376  99%  turbo
     105M     12     138  99%  stefan
     144M      2      74  99%  render
     323M    141    1175  98%  haywire
     256M    293    3179  94%  3D
      80M    107    1475  90%  LightWave
--------------------------------------------------------------
     6.0G   1929   28554  97%  E:\   (depth: 11)
E:\>_

Above is the output from Zdu using the new switch 'human readable format' (/h), which is new from version 2.2.

6. SYNTAX AND USAGE

Zdu v2.4 has the following commandline syntax: (result of typing zdu /?)

---------------------------
<insert output here>
--------------------------

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. Entering a 'k' after the number will treat it as kilobytes instead of bytes, e.g. "/f:32k" to fake the size to 32 kilobytes.
h
Print usage in human readable format.
The usage numbers (both bytes and cluster formats) will be printed in more easily to read numbers using suffix, like k, M and G (as in kilo-, Mega- Gigabytes) depending on the size of the number. Similar to the "-h" switch on some versions of "du".
i
Print disk info header only.
Basically a shortcut for the format specifier /F:0i, which causes all directory scanning to be skipped and only print the disk info header (free, total, filesystem etc.)
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 the disk usage recursively.
New from 2.3.097, this has gone through a total remake, and is now quite easy to understand, it aims to display the directory tree in a familiar 'explorer' tree.
s
Silent mode.
Will only output the bottom line, i.e. the total usage of the scanned path.
t
Non-standard sTreams.
Only supported on NTFS disks. This will search every single file for non-standard streams and add the sizes of those to the file size. It will also add the streams column to the output, which will display the number of non- standard streams collected in the directory.

u:user Report usage of file/dirs owned by a user (=[domain\]user).
Under Windows NT Zdu can filter the usage calculation to only
count the files which are owned by the specified user.
If a domain is included in the user specification it must also
match the file owner. Entering something like "/u:.\haywire"
would count only file owned by user "haywire" on the local
computer.

ud:user Same as the u:user switch, but filters directories as well as
files.
 

x[:sort] Show usage based on filename eXtension also. Specifying
this switch Zdu will output a table with extension after the
normal report (with dirs, files & usage).

The table can be sorted in three ways. This is done by supplying
one of these sorting characters after a colon:
x by extension, default, descending
n by number of files, ascending
u by usage, ascending
e.g. "/x:n" to sort by number of files. The sorting order can
not be controlled at this point.
 

F:<fmt> Modifies the output from Zdu.
<fmt> can be one or more of the following:
0 clear all
* set all
- disable the following feature
d add directories column
f add files column
u add usage column
p add path column
i add disk info header
t add sTreams column
x[:sort] add display of extensions table
By specifying any of the column fields or feature, it will be
added unless the '-' preceeds it, e.g. enter /F:t and Zdu
will add the streams column (labeled 'S') to the output, or
entering /F:-d will remove the 'Dirs' column from the output.
By default Zdu outputs Dirs, Files, Usage, Efficiency and
Path columns. If all features are cleared (with '0' or - for
all), the default output format will be used.
The order of the columns can not be specified.
 

NOTE: The switches are CASE-sensitive.

Path:
Any valid path can be given as argument to zdu, only directories
ofcourse. Zdu now also support UNC path's, i.e. the disk scanned
does not need to be mounted. e.g.: "\\<machine>\<share>\...".
 

Filter:

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, REPORTING
 


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 suggestions, or maybe some flames?

e-mail: haywire@fatalunity.com


8. FUTURE IDEAS

What Zdu will hopefully do in the future:

- Support for Windows' shortcuts and Cygnus' soft links.

- Filter collected files on more criterias other than filename, e.g. creation date, modification date, attributes etc.

What Zdu will NOT do/have:

- A GUI (there are so many (bad) GUIs already), and I think it serves no
purpouse for this kind of thing.
(As you might have seen, there is now a GUI, but importantly, the GUI
is a seperate executable. And the text-version is still the main focus)

- DLL files spread around the system. (although it sometime uses some
system DLL:s under NT)
 

Suggestions? Mail me! (feedback is of the essence!)
e-mail: haywire@fatalunity.com (preferrably with subject containing 'zdu')


9. DEVELOPMENT

Info : C-source : ~90 kbytes (in ~4000 rows) (mixed C and C++)
Exe-file : ~60 kbytes (text)
~44 kbytes (GUI) (this is kinda strange)
Build time : ~30 sec

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

Docs : Notepad (accept no limitations!)

Hardware : PII-400 256Mb 8.5G+20G


10. AUTHOR

This little piece of software was written by a bloke named André Jonsson,
that's me and I'm from Skellefteå, Sweden.
Visit my homepage at: http://haywire.fatalunity.com
All revisions of Zdu is be downloadable from there. Updates included
ofcourse. If you wan't an older version (why?), you'll need to send me
and e-mail about it (they are on the server just not visible from the
webpages).

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

I have previously also released a program called Zap (a DOS program),
which is a file/directory removing utility. It is publically available
on SimTel mirrors, and elsewhere. Check it out, will ya!
The archive is called AJZAP266.ZIP.

e-mail: haywire@fatalunity.com


11. VARIOUS

During development of Zdu the following music was listened to:

2 Unlimited: Hits unlimited
Anthrax: The threat is real, Volume 8
Anthrax: Attack of the killer B's
Enya: The celts
Helloween: Better Than Raw
Meshuggah: Destroy Erase Improve
Meshuggah: Contradictions Collapse & None
Meshuggah: Chaosphere
Pantera: The great southern trendkill
Pantera: Vulgar display of power
Rammstein: Sehnsucht
Rage Against the Machine: Evil Empire
Skunk Anansie: Post orgasmic chill
Sugar Ray: Lemonade and Brownies
S.O.D.: Bigger than the devil
Testament: The Gathering
Tracy Bonham: The burdens of being upright
ZZ-Top: The very best of

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


12. SPECIAL THANKS

Some special yahoo's goes out to the following:

- Data Ductus AB Employer
- Andreas Wiklund Author of the crackwhiz string matching routine,
feature suggestions, and RL-tester.
 
 

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

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 all the way down here! If you meet someone else who managed to
do the same, you better start a club or something because you are some rare
people! :-)