Haywire Software (HSw)presentsZ D U - release 2(C)Copyright 1995-2000 Haywire Software Written by: André Jonsson <haywire@fatalunity.com> |
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.
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)!
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(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.
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.
- zdu.exe: the text-only version, meant to be run from a prompt
- zdugui.exe: GUI version
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 E: drive:
E:\>zdu /h E: "DATA" 3760:353D - FS:FAT32 - Cluster:8k Total: 15 711 338 496 [14G] - Free: 8 384 667 648 [7G] Usage(B) Dirs Files Eff Path -------------------------------------------------------------- 823M 209 4442 97% download 14M 33 207 92% RECYCLED 1.0G 223 5411 97% data 502M 0 11 99% BeOS 80M 115 1487 90% temp 7.3M 2 53 97% usr 3.5G 347 6376 99% turbo 105M 12 138 99% stefan 144M 2 74 99% render 360M 151 1325 98% haywire 256M 293 3179 94% 3D -------------------------------------------------------------- 6.8G 1398 22714 98% E: (depth: 10) E:\>_Above is the output from Zdu using the new switch 'human readable format' (/h), which is new from version 2.2.
Zdu v2.4 has the following commandline syntax: (result of typing zdu /?)
Zdu v2.4 BETA 3 - (C)1995-2000 Haywire Software July 29, 2000 Feedback email: haywire@fatalunity.com Usage: Zdu [/<switches>] [<path1>[\<filter>]] <switches>: c Print usage in clusters, instead of bytes d Do not count directories as an allocated cluster 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 (eq. to /F:0i) 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 the other fields and diskinfo 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[:sort] Show eXtension usage table, sort can be on of these: x Sort by eXtension (ascending) u Sort by Usage (descending) c Sort by file count (descending) F:<fmt> Format of output. <fmt> can be one or more of the following: 0 Clears the output format, no columns left * Sets all fields and output features -<c> Exclude the column <c> d Dirs column e Efficiency column f Files column i Disk Info header p Path column (and filter) t sTreams column u Usage column x[:s] eXtension usage table (sort same as /x switch) <path>: Any path, including UNC ones (no path means current path) <filter>: Any glob pattern. e.g.: *.png or haywire?.htm*Switches: (Note, the switches are parsed CASE-sensitively).
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.
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 Similar to the u:user switch
But also filters directories as well as files.
x[:sort] Show usage per filename eXtension
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, descending (this is the default)For example, use /x:n to sort by number of files. The sorting order can not be controlled at this point.
c by number of files, ascending
u by usage, ascending
F:<fmt> Modifies the output from Zd
<fmt> can be one or more of the following:0 clear allBy 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.
* set all
- disable the feature that follows this character
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 (see 'x' switch)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.
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?
- NTFS directories are not handled correctly, but in large should give a reasonably correct result.
e-mail: haywire@fatalunity.com
What Zdu will hopefully do in the future:What Zdu will NOT do/have:
- 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.
Suggestions? Mail me! (feedback is of the essence!)
- A GUI (there are so many (bad) GUIs already), and I think it serves no purpouse for this kind of thing.
Update:As you might have seen, there is now a GUI. However, more 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)
Source code: ~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
Hardware: PII-400 256Mb 8.5G+20G
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 :-)
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
During development of Zdu the following music was listened to:And, mind you, these are no mp3 crap, it's the real deal, well... atleast CD anyway.
- 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
Some special yahoo's* goes out to the following:*) no relations to Yahoo.com.
- Data Ductus AB: Employer
- Andreas Wiklund: Author of the crackwhiz string matching routine, feature suggestions, and RL-tester.
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! :-)