home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / c / chkfra.zip / CHKFRA.DOC < prev    next >
Text File  |  1992-08-04  |  5KB  |  102 lines

  1. CHKFRAG (Current version: 1.7 - March 13, 1992)
  2. Bob Flanders and Michael Holmes
  3. --------------------------------------------------------------------------
  4. Copyright (c) 1992 Ziff Communications Co.
  5. First Published in PC Magazine August, 1989 (Utilities)
  6. --------------------------------------------------------------------------
  7.  
  8. Purpose:   To report, on-screen, the extent of file fragmentation on a hard
  9.            disk, and provide an ERRORLEVEL value usable within a batch file
  10.            to call a defragmenting program.
  11.  
  12. Format:    CHKFRAG [d:] [/% | /N | /E | /F] [/L] [/4]
  13.  
  14. Remarks:   Executed without any of its optional parameters, CHKFRAG
  15.            produces a screen report indicating the number of files and
  16.            directories, how many and what percentage of these are
  17.            fragmented, and how many extra (non- contiguously stored) parts
  18.            of files are contained on the currently-logged drive.  An
  19.            ERRORLEVEL code from 0-100, reflecting the percentage of
  20.            fragmented files, (the /% parameter is the default) is also
  21.            shown.
  22.  
  23.            An alternative drive (d:) to be analyzed may be specified, as
  24.            may be ERRORLEVEL return codes that reflect the actual number of
  25.            fragmented files (the /N parameter), the number of contiguous
  26.            free areas on the disk or of extra sections (the /E parameter).
  27.            The ERRORLEVEL return codes are not intended for strict
  28.            accuracy:  if any file is fragmented the minimum ERRORLEVEL
  29.            returned by the /% parameter is 1%, and 254 is the maximum
  30.            ERRORLEVEL returned by the /N and /E switch options.  These
  31.            return codes are intended to be used to trigger automatic
  32.            loading and execution of the user's defragmenting utility from
  33.            within a batch file.  An ERRORLEVEL return code of 255 is used
  34.            to indicate an error condition, which halts operation.
  35.  
  36.            If desired, a list of the names of fragmented files and
  37.            directories can be produced by specifying the optional /L
  38.            parameter.  The normal screen output from CHKFRAG may be
  39.            redirected to a file or to a printer, for easier analysis.
  40.  
  41.            If you are using DOS 3.31 (or any version of DOS before 4.x that
  42.            used 32 bit sector numbers for large hard disks), the /4
  43.            parameter will cause CHKFRAG to use a the DOS 4.x interface for
  44.            large drives.
  45.  
  46.            The DOS CHKDSK command, specified with its /F switch, should be
  47.            executed before running CHKFRAG; lost clusters or cross-linked
  48.            files are interpreted by CHKFRAG as a error condition.  Drives
  49.            created with the DOS ASSIGN or SUBST commands, and directories
  50.            created by JOIN, are not checked by CHKFRAG.  While analyzing
  51.            large disks, the utility requires approximately 100KB of
  52.            available RAM.  On-screen recommendations are to consider using
  53.            a defragmenting utility when file fragmentation is in the range
  54.            from 11% to 75%, and definitely to defragment disks that show
  55.            more than 75% fragmentation.
  56.  
  57.            CHKFRAG.EXE was written in the C language and its source code
  58.            should be compiled using the Microsoft C Compiler, Version 5.1
  59.            or later.
  60.  
  61.            Compile as follows:
  62.  
  63.                 CL /AL CHKFRAG.C
  64.  
  65. Notes:     If CHKFRAG is used within a batch job, the "/%" parameter must
  66.            be specified as "/%%".  This is necessarcy because the DOS batch
  67.            interpreter uses the percent (%) character to indicate where
  68.            replaceable parameters are to be inserted in the command line.
  69.  
  70.  
  71. /* ******************************************************************** *
  72.  
  73.     Maintenance log
  74.  
  75.     Version   Date   Description                            Who
  76.     ------- -------- -------------------------------------- ----------
  77.     1.0 to 1.3       Various bug fixes                      Flanders/Holmes
  78.     1.3
  79.  
  80.     1.4     16Dec91  DOS 5 compatibility                    Flanders/Holmes
  81.                       .. Read FAT greater than 64K long
  82.                       .. Minor compiler error on readlabel()
  83.                       .. Compiles under MSC 6.0
  84.                       .. Added pack pragma to remove need for
  85.                          /Zp operand on compile
  86.                       (Thanks to J. Stephen Myers for his fixes
  87.                        to v1.2)
  88.  
  89.     1.5     15Jan92   Two unrelated bugs ..                 Flanders
  90.                       .. /F returned EXTRA SEGMENT value.
  91.                          Now returns free segments.
  92.                       .. Didn't check SUBST under DOS 5
  93.                       (Thanks to Bruce Vrana for reporting
  94.                        these bugs!)
  95.  
  96.     1.6     16Jan92   Didn't recognize a LANTASTIC local    Flanders/Holmes
  97.                          shared drive as a network drive
  98.  
  99.     1.7     11Mar92   Miscalulated 12 or 16 bit fat fixed   Flanders/Holmes
  100.  
  101.  * ******************************************************************** */
  102.