home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 6 File
/
06-File.zip
/
usage11.zip
/
USAGE11.DOC
< prev
next >
Wrap
Text File
|
1995-03-31
|
6KB
|
149 lines
03-31-95 3:28pm
**The USAGE Utility**
Version 1.10
BY: Reed R. Mangino
email: tornado@esu.edu
IMPORTANT:
USAGE and everything contained therein is FREEWARE. Do with it
what you like. I happen to think it is a handy little utility, but
then again I have a type A personality! :) If you have any comments
about USAGE, please drop me a line at my email address.
If USAGE blows up your computer or harms any fury little animals I
cannot be held responsible! What the heck do I know, I'm just a poor
college kid!
USEAGE10.ZIP should contain the following:
FILE_ID . DIZ 671 Quick description of USAGE
USEDOS16 . EXE 35,038 16-bit DOS executable
USEOS2 . EXE 23,756 32-bit OS/2 executable
USAGE10 . DOC 5,907 This file
** If any of these files are missing or their sizes have changed please
** do not use any of the executables! Email me and I will see that you
** get a valid copy.
OS/2 USERS:
USAGE knows all about long filenames and non-DOS directories!
USEOS2.EXE does NOT count extended attributes. On my HPFS drive
(300meg) USEOS2.EXE was off by a whopping 11 bytes! :)
PURPOSE:
USAGE.EXE is a utility that displays the amount of disk space
that your directories are utilizing. Run USAGE from any directory
and each immediate sub directory will be displayed along with the
total amount of disk space used by that directory AND the percentage
of that usage.
NOTE: USAGE.EXE counts ALL files: HIDDEN, SYSTEM, READONLY, ARCHIVE
If the output from USAGE scrolls off the screen, pipe the output
to MORE. For example:
C:\USAGE | MORE <return>
INSTALLATION:
Nothing special has to be performed to start using USAGE. Just throw
the desired executable into a directory in your PATH and off you go.
IMPORTANT: You CAN rename any of the executables to any name you like.
So you could rename USEDOS16.EXE to USAGE.EXE to save some
keystrokes. Just remember which operating system the executable is
for.
QUICK EXAMPLE:
A quick example should show you EXACTLY what USAGE does! I have
renamed USEDOS16.EXE to USAGE.EXE for these examples. It is assumed
that USAGE.EXE is in the PATH.
D:\USAGE<return>
YIELDS:
Directory Total Usage % Usage
--------- ----------- -------
D:\ 262563 0.12%
DISKS 14319069 6.51%
PC 3792334 1.73%
GAMES 68749014 31.28%
BP 15383497 7.00%
PCTOOLS 5807884 2.64%
MISC 20033756 9.11%
DELETE 117788 0.05%
ZDBENCH 3000981 1.37%
TEMP 202223 0.09%
TC 8338258 3.79%
WGT 4773091 2.17%
WATCOM 75014603 34.13%
-----------
TOTAL: 219795061
You can read this as: The root dir of D:\ contains 262563 bytes that
account for 0.12% of the total files located below (and including) the
root directory. You can see that the contents of the WATCOM directory
makes up for 34.13% of the disk usage.
Now that we know that the GAMES directory is taking up 68 megs of
disk space, lets see what individual game is the largest.
Just change the current directory to D:\GAMES and invoke USAGE as
above.
D:\GAMES\USAGE<return>
YEILDS:
Directory Total Usage % Usage
--------- ----------- -------
D:\GAMES 0 0.00%
DOOM2 22543025 32.79%
HOCKEY 9709227 14.12%
CM 3235985 4.71%
MOON 3819020 5.56%
LINKS 7406525 10.77%
HEXX 611244 0.89%
HTIC 12329165 17.93%
DESCENT 7170379 10.43%
MYST 1924444 2.80%
-----------
TOTAL: 68749014
OUCH, DoomII takes up 22 megs! Well I still love the game, so I'll
keep it.
REMEMBER: As long as USAGE.EXE is in your path you can see the stats
for any directory on your drive.
--------------------------------------------------------------------------
PERSONAL STUFF:
Man you must be bored! :) I wrote this program to refresh my C++
skills. The fact that I bought a new multi-platform compiler didn't
hurt things either!
The USAGE idea interested me because I have seen directory traversal
code that was over 100 lines long (no recursion of course). Even the
recursive routines were a bit clumsy. So I set out to write a tight
directory traversal. What I came up with was All_Dirs(char *path).
All_Dirs is a stunning 7 lines of C code! Of course, it took me about
2 days to get it there! :)
There's not much to say about me other than I love to program and
mess with my computer. I have a Pentium-60 and I finally got my new
"bug free" CPU! Thanks INTEL! :)
I am currently in my senior year at East Stroudsburg University,
located in East Stroudsburg, PA, USA. I am studying Computer Science
and I would be loving life if it weren't for all these darn math
classes.
Drop me a line if you have comments about USAGE. BTW, if you like
USAGE, go get DELEX from ftp:\\garbo.uwasa.fi or ftp:\\oak.oakland.edu.
If you work with ZIP files at all, DELEX will make your life much
easier. It is THE deletion exception for DOS!
YO!
--------------------------------------------------------------------------
CHANGES FROM 1.00
A function was created to separate long numbers by commas for
readability purposes.