Dec 182017
Fast display of disk statistics (space, etc.).
File DSTATS.ZIP from The Programmer’s Corner in
Category Utilities for DOS and Windows Machines
Fast display of disk statistics (space, etc.).
File Name File Size Zip Size Zip Type
DSTATS.COM 2563 1513 deflated
DSTATS.DOC 9309 3572 deflated

Download File DSTATS.ZIP Here

Contents of the DSTATS.DOC file

DSTATS version III, Copyright 1988 by Charles Lazo III

DSTATS = Drive STATisticS is a small utility written in assembly language that
reports on the information returned by the GET FREE DISK SPACE function of DOS
for user selected (logical) disk drives. Essentially, DSTATS issues the same
information as the DOS CHKDSK.COM program; however, more (or less) information
can be provided for the selected drives and the program runs faster because
DSTATS does not check out the disk(s) File Allocation Table(s) as does CHKDSK.

The provisions of the copyright of DSTATS are that it may be freely copied and
distributed and it may even be sold separately or in a collection with other
programs. The only restriction is that this documentation must accompany any
such distribution of the program and neither the documentation nor the program
may be altered in any way. An exemption on program alteration is provided to
individuals who purchase the source code; however, even they may not distribute
alterations of the program. (Source may be purchased for $10.00, see the last
section of this documentation for details.)

The operation of DSTATS is controlled by an environment variable with the same
name. The user sets this environment variable either at the DOS command line
or via a batch file. Command line parameters, if entered, shall override the
environment variable. If the first character on the command line is a question
mark preceded only by either spaces or tabs or if there is no command line
entry and the DSTATS environment variable has not been set when the program is
run, then after the display of the copyright message the following information
is given:

Setup for DSTATS requires "SET DSTATS=[;]" to be
entered at the DOS prompt or in a batch file before running the DSTATS program.
See the file DSTATS.DOC for more information and examples. Note: A command
line entry using the same syntax as the environment variable overrides any
environment setting for DSTATS and a command line entry with a question mark as
the first non space/tab character also causes this message to be displayed.

field # DSTATS report heading Meaning

1 Total space Total bytes that can be stored on drive
2 Bytes used Total bytes currently stored on drive
3 Bytes free Total bytes available for use
4 Sec/cls Sectors per cluster
5 Free cls Total clusters currently free
6 Byte/sec Bytes per sector
7 Total cls Total clusters on disk

The information is meant to be a memory aid and not a substitute for this
extended documentation. Thus setting the DSTATS environment variable with the

set dstats=[;]

is the first step required to prepare DSTATS for proper operation. Note that
capitalization is not significant; any mixture of small- and uppercase can be
used to enter the SET command. "" and ";" are
formal indicators of proper syntax for the SET command. Henceforth, the two
parts of the variable shall be given the names "drives entry" and "fields
entry" respectively. They may be best illustrated by examples. (The brackets
surrounding the fields entry means it is optional.)

Entering this command, set dstats=ab;123, at the DOS prompt or in a batch file
and then running the DSTATS program results in, for example, the output:

Total space Bytes used Bytes free
A 362496 311296 51200
B 362496 352256 10240

Just doing set dstats=ab, would give the same result, since the value ";123" is
the default setting for the fields entry value.

As many drive letters as desired may be placed in the drive entry and repeated
drive letters are allowed. Repeated numbers are not allowed in the fields
entry. Blank lines may be inserted in the report output by placing either of
the two characters "@", the at sign, or "`", the grave accent, in the drives
entry. These two characters are the only nonalphabetic characters allowed in
the drives entry. (Actually, this is not strictly true. See the "Technical
Notes" section for details). Only the digits 1-7 are allowed in the fields
entry (aside from the ";" character).

Setting the dstats variable to @[email protected];3645 and running dstats on my system gives
this output

Bytes free Byte/sec Sec/cls Free cls

A 51200 512 2 50

C 1126400 512 8 275
D 1056768 512 2 1032

Where drive A contains the same diskette as it did for the earlier report, C
drive is a hard disk partition, and D drive is an EMS ram disk. Multiplying
the numbers in columns 2, 3, and 4 gives the numbers in column 1. Note the
"@" characters in the environment variable produce the blank lines after the
heading and the A drive report.

There are a variety of error messages. All of them explicitly refer to the
environment variable DSTATS; however, if a command line entry is made to over-
ride an environment variable, then the messages are really referring to the
command line entry.


Due to the difficulty of software development and testing it is next to
impossible to determine with certainly that programs will never cause problems
in all of the environments to which they are exposed. Therefore, I as the
holder of the copyright of this program assume no responsibility whatsoever for
any damages which may be caused either directly or indirectly by the program.
By using the DSTATS program you agree to this provision.

Technical Notes

Dos function 36h, Get Free Disk Space, is used to obtain the data provided in
the report. Although the numbers for bytes per sector and sectors per cluster
are reported by this function in word sizes, it is assumed in this program that
the product of these numbers is also of word size. Consequently, DSTATS will
only be able to issue a valid report for disks with total storage capacity that
is less than 4 gigabytes. Considering the size of up and coming CD drives this
may be a major limitation. Persons wishing to have the program work on larger
drives may either purchase the source code and make the needed alterations
themselves, or contract me or another to make the changes.

Earlier it was mentioned that only alphabetic characters are allowed in the
drives entry of the dstats environment variable. In fact, any characters with
ASCII value greater than or equal to that of the at sign character, "@", are
allowed. Of course, the at sign and grave accent characters have special
meanings for the report and cannot be symbols for drives. Whether DOS will
allow the use of any of these characters to designate logical drives I do not
know, but they are supported nevertheless.

As previously mentioned the default entry for the fields entry is ";123". If
desired the location in the DSTATS.COM file that contains this value can be
altered with a byte editor. The offset in the file of this value is hex 6DE or
from within DEBUG with its 100h offset: 7DE. The field is seven bytes wide
and the semicolon is not included. Any permutation of the seven digits 1 to 7
may be placed there. These numbers are not checked for validity, so make sure
that there are only up to seven entered, that they are in the range 1 - 7 and
that there are no repetitions. Finally, adjust the byte at DEBUG offset 7DD,
the byte just prior to the default entry field, to the number of field entry
values that DSTATS shall use. This value is initially set to 03 and can be
made as high as 07 or as low as 01. Changing it to a value outside this range
is asking for trouble. The changed values will then be the default.

Source Code Availability

The source code for DSTATS is available to persons on an individual basis.
Companies interested in a source code site license should contact the author at
the address given below. Cost is $10.00 for the latest version and delivery is
either by mail via 5 1/4 inch floppy disk or via CompuServe's Easyplex binary
mail. Money orders and checks are acceptable as payment. If the binary Email
option is selected the code will be sent upon receipt of payment. Be sure
to either send me your CompuServe user ID with your payment or a message via
Easyplex. The program is supported for all users (source code purchasers or
not) via Easyplex or US mail.

Charles Lazo III CIS user ID 72210,17
P.O. Box 452
Hohenwald, TN 38462

 December 18, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>