home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
165
/
CHKFRA.ZIP
/
CHKFRA.DOC
< prev
next >
Wrap
Text File
|
1992-08-04
|
5KB
|
102 lines
CHKFRAG (Current version: 1.7 - March 13, 1992)
Bob Flanders and Michael Holmes
--------------------------------------------------------------------------
Copyright (c) 1992 Ziff Communications Co.
First Published in PC Magazine August, 1989 (Utilities)
--------------------------------------------------------------------------
Purpose: To report, on-screen, the extent of file fragmentation on a hard
disk, and provide an ERRORLEVEL value usable within a batch file
to call a defragmenting program.
Format: CHKFRAG [d:] [/% | /N | /E | /F] [/L] [/4]
Remarks: Executed without any of its optional parameters, CHKFRAG
produces a screen report indicating the number of files and
directories, how many and what percentage of these are
fragmented, and how many extra (non- contiguously stored) parts
of files are contained on the currently-logged drive. An
ERRORLEVEL code from 0-100, reflecting the percentage of
fragmented files, (the /% parameter is the default) is also
shown.
An alternative drive (d:) to be analyzed may be specified, as
may be ERRORLEVEL return codes that reflect the actual number of
fragmented files (the /N parameter), the number of contiguous
free areas on the disk or of extra sections (the /E parameter).
The ERRORLEVEL return codes are not intended for strict
accuracy: if any file is fragmented the minimum ERRORLEVEL
returned by the /% parameter is 1%, and 254 is the maximum
ERRORLEVEL returned by the /N and /E switch options. These
return codes are intended to be used to trigger automatic
loading and execution of the user's defragmenting utility from
within a batch file. An ERRORLEVEL return code of 255 is used
to indicate an error condition, which halts operation.
If desired, a list of the names of fragmented files and
directories can be produced by specifying the optional /L
parameter. The normal screen output from CHKFRAG may be
redirected to a file or to a printer, for easier analysis.
If you are using DOS 3.31 (or any version of DOS before 4.x that
used 32 bit sector numbers for large hard disks), the /4
parameter will cause CHKFRAG to use a the DOS 4.x interface for
large drives.
The DOS CHKDSK command, specified with its /F switch, should be
executed before running CHKFRAG; lost clusters or cross-linked
files are interpreted by CHKFRAG as a error condition. Drives
created with the DOS ASSIGN or SUBST commands, and directories
created by JOIN, are not checked by CHKFRAG. While analyzing
large disks, the utility requires approximately 100KB of
available RAM. On-screen recommendations are to consider using
a defragmenting utility when file fragmentation is in the range
from 11% to 75%, and definitely to defragment disks that show
more than 75% fragmentation.
CHKFRAG.EXE was written in the C language and its source code
should be compiled using the Microsoft C Compiler, Version 5.1
or later.
Compile as follows:
CL /AL CHKFRAG.C
Notes: If CHKFRAG is used within a batch job, the "/%" parameter must
be specified as "/%%". This is necessarcy because the DOS batch
interpreter uses the percent (%) character to indicate where
replaceable parameters are to be inserted in the command line.
/* ******************************************************************** *
Maintenance log
Version Date Description Who
------- -------- -------------------------------------- ----------
1.0 to 1.3 Various bug fixes Flanders/Holmes
1.3
1.4 16Dec91 DOS 5 compatibility Flanders/Holmes
.. Read FAT greater than 64K long
.. Minor compiler error on readlabel()
.. Compiles under MSC 6.0
.. Added pack pragma to remove need for
/Zp operand on compile
(Thanks to J. Stephen Myers for his fixes
to v1.2)
1.5 15Jan92 Two unrelated bugs .. Flanders
.. /F returned EXTRA SEGMENT value.
Now returns free segments.
.. Didn't check SUBST under DOS 5
(Thanks to Bruce Vrana for reporting
these bugs!)
1.6 16Jan92 Didn't recognize a LANTASTIC local Flanders/Holmes
shared drive as a network drive
1.7 11Mar92 Miscalulated 12 or 16 bit fat fixed Flanders/Holmes
* ******************************************************************** */