Haywire Software (HSw)

presents

Z D U - release 2

(C)Copyright 1995-2000 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, VIRTUAL 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: 386 or better
MEM: ~1Mb (GUI version ~2Mb) - this depends on the directory scanned
OS: Windows 9x/NT(Intel)/2000
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

Note: this text file does not contain any description of the Zdu GUI. That will hopefully be included in the full v2.4 release.

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 well as a total size. 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 is basically 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 D: drive:

D:\>zdu /h
D: "DATA" - FS:FAT32 - 3760:353D Cluster:8k
Total: 15 711 338 496 [14G] - Free: 7 148 961 792 [6G]
 Usage(B)   Dirs   Files  Eff  Path
--------- ------ ------- ----  --------
     1.9G    378    5646  98%  download
      13M     32     205  92%  RECYCLED
     367M    260    5680  93%  data
     7.6M      3      57  97%  usr
     3.6G    349    6421  99%  turbo
     105M     12     138  99%  stefan
     450M      4     172  99%  render
     1.0G    233    2400  98%  haywire
      85M    105    1334  92%  program files
     262M    292    3206  94%  3D
--------- ------ ------- ----  --------
     8.0G   1678   25265  98%  D:\   (depth: 10)
D:\>_

The main GUI looks like this:

And with the configuration window shown:

6. SYNTAX AND USAGE

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

Zdu v2.4.3 - (C)1995-2001 Haywire Software                   April 13, 2001
Feedback email: haywire@fatalunity.com

Usage: Zdu [/<switches>] [<path1>[\<pattern>]]
<switches>:     *case sensitive*
  ?        Show this text. Use '/?:<switch>' to get info about switch
  ,        Use comma as thousands separator instead of space
  c        Print usage in clusters, instead of bytes
  d        Do not count directories as an allocated cluster
  e        Ignore scanning Errors, e.g. 'Access denied'
  f[:N]    Fake clustersize to N bytes
  h        Print usage in human readable format (e.g. 1.2M, 34k)
  i        Print disk info header only
  k        Print usage in units of 1024 bytes/clusters
  r        Print usage recursive
  s        Short mode (just summary usage and path)
  S        Like /s but includes all standard columns and the disk info
  t        Collect non-standard sTream sizes also
  u:user   Report usage of files owned by a user (=[domain\]user)
  ud:user  Same as /u, but filters both dirs and files.
  x:<pat>  Exclude files that matches <pat>
  F:<fmt>  Format of output, see /?:F
  O<args>  Specify sorting order of above output modes, see /?:O
  U:<fmt>  Select 'Usage by' outputs, see /?:U

<path> :    Any path, including UNC ones (no path means current path)
<pattern> & <pat> :  Any globbing pattern. e.g.: *.png or haywire?.htm*

Switches: (Note, the switches are parsed CASE-sensitively).

,
Use comma instead of space as thounsands separator
Prints 1,234,567 instead of 1 234 567.
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).
e
Ignore scanning errors
Doesn't print any errors encountered during a scan.
f[:N]
Fake clustersize.
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".
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. This switch disables the 'S' switch.
s
Silent mode.
Will only output the bottom line, i.e. the total usage of the scanned path.
S
Similar to the 's' switch
But includes the configured fields and the disk info header. If this switch is given Zdu will only return the total usage of the specified path plus the available info about the disk.
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 on NTFS disks 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
Similar to the u:user switch
But also filters directories as well as files.
U:<fmt>
Selects one or more output lists
d Usage by Dir (default).
x Usage by file Extension.
o Usage by Owner (NTFS only).
Entering for example /U:dx will enable 'Usage by dir' and additionally the 'Usage by extension' lists.
F:<fmt>
Modifies the 'usage by dir' output from Zdu
<fmt> can be one or more of the following:
0 clear all
* set all
- disable the feature that follows this character
d (add) Directories column
e (add) Efficiency column
f (add) Files column
i (add) disk Info header
p (add) Path column
t (add) sTreams column
u (add) Usage column
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.
O<list>:<col>
Specify sorting order for all Zdu's output lists
List can be one of the following:
d Set sorting for 'Usage by Directory' list.
x Set sorting for 'Usage by Extension' list.
o Set sorting for 'Usage by Owner' list.
And subsequently the col values for each list:
For 'Usage by directory':
d Directories
e Efficiency
f Files
p Path
t Streams
u Usage
For 'Usage by extension':
c Count
u Usage
x eXtension
For 'Usage by Owner':
d Directories
f Files
o Owner
u Usage

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: What Zdu will NOT do/have: Suggestions? Mail me! (feedback is of the essence!)

9. DEVELOPMENT

Source code: ~90 kbytes (in ~4000 rows) (mixed C and C++)
Exe-file: ~84 kbytes (text) ~68 kbytes (GUI)
Build time: ~30 sec
Platform: Windows NT 4.0 & Windows 2000
Software: MS Visual C++ 5.0 & 6.0
Hardware: PII-400 384Mb 28G

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 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 :-) Can't keep my fingers away, I guess.

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: And, mind you, these are no crap mp3, it's the real deal, well... atleast CD anyway.

12. SPECIAL THANKS

Some special yahoo's* goes out to the following: *) no relations to Yahoo.com.


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! :-)