Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought


 diskcomp(CMD)                   19 June 1992                   diskcomp(CMD)


 Name

    diskcomp - compare the contents of two floppy disks

 Syntax


    diskcomp [drive1: [drive2:]] [/1] [/8]


 Description

    This command performs a track-by-track comparison.  diskcomp determines
    the number of sides and sectors per track to compare based on the format
    of the first disk you specify.

 Parameters


    drive1: Specifies the drive containing one of the floppy disks.

    drive2: Specifies the drive containing the other floppy disk.


 Switches


        /1  Compares only the first sides of the disks, even if the disks are
            double-sided and the drives can read double-sided disks.

        /8  Compares only the first 8 sectors per track, even if the disks
            contain 9 or 15 sectors per track.


 Notes


    Invalid drive for diskcomp

    The diskcomp command works only with floppy disks.  You cannot use
    diskcomp with a hard disk.  If you specify a hard disk drive for drive1
    or drive2, diskcomp displays the following error message:

       Invalid drive specification
       Specified drive does not exist
       or is non-removable


    Diskcomp messages

    If all tracks on the two disks being compared are the same, diskcomp dis-
    plays the following message:

       Compare OK


    If the tracks are not the same, diskcomp displays a message similar to
    the following:

       Compare error on side 1, track 2


    When diskcomp completes the comparison, it displays the following mes-
    sage:

       Compare another diskette (Y/N)?


    If you press Y, diskcomp prompts you to insert disks for the next com-
    parison.  If you press N, diskcomp stops the comparison.

    diskcomp ignores a disk's volume number when it makes the comparison.

    Omitting drive parameters

    If you omit the drive2 parameter, diskcomp uses the current drive for
    drive2. If you omit both drive parameters, diskcomp uses the current
    drive for both.  If the current drive is the same as drive1, diskcomp
    prompts you to swap disks as necessary.

    Using one drive for the comparison

    If you specify the same floppy disk drive for drive1 and drive2, diskcomp
    does a comparison by using one drive and prompts you to insert the disks
    as necessary.  You might have to swap the disks more than once, depending
    on the capacity of the disks and the amount of available memory.

    Comparing different types of disks

    diskcomp cannot compare a single-sided disk with a double-sided disk, nor
    a high-density disk with a double-density disk.  If the disk in drive1 is
    not of the same type as the disk in drive2, diskcomp displays the follow-
    ing message:

       Drive types or diskette types not compatible


    Using diskcomp with networks and redirected drives

    diskcomp does not work on a network drive or on a drive created or
    affected by an assign, join, or subst command.  If you attempt to use
    diskcomp with a drive of any of these types, diskcomp displays an error
    message.

    Comparing an original disk with a copy

    When you use diskcomp with a disk that you made with the copy command,
    diskcomp may display a message similar to the following:

       Compare error on side 0, track 0


    This type of error can occur even if the files on the disks are identi-
    cal. Although the copy command duplicates information, it does not neces-
    sarily place it in the same location on the destination disk. For more
    information about comparing individual files on two disks, see the
    fc(CMD) command.

    Diskcomp exit codes

    The following list shows each exit code and a brief description of its
    meaning:

         0  The disks are the same.

         1  Differences were found.

         2  The user pressed CtrlC to stop the process.

         3  A hard error occurred.

         4  An initialization error occurred.

    You can use the errorlevel parameter on the if command line in a batch
    program to process exit codes returned by diskcomp. For an example of a
    batch program that processes exit codes, see the following ``Examples''
    section.

 Examples

    If your system has only one floppy disk drive, drive A, and you want to
    compare two disks, type the following command:

       diskcomp a: a:


    diskcomp prompts you to insert each disk, as required.

    Following is an example of a batch program that uses the errorlevel
    parameter on the if command line to process a diskcomp exit code:

       rem CHECKOUT.BAT compares the disks in drive A and B
       echo off
       diskcomp a: b:
       if errorlevel 4 goto ini_error
       if errorlevel 3 goto hard_error
       if errorlevel 2 goto break
       if errorlevel 1 goto no_compare
       if errorlevel 0 goto compare_ok
       :ini_error
       echo ERROR: Insufficient memory or command invalid
       goto exit
       :hard_error
       echo ERROR: An irrecoverable error occurred
       goto exit
       :break
       echo You just pressed CTRL+C to stop the comparison
       goto exit
       :no_compare
       echo Disks are not the same
       goto exit
       :compare_ok
       echo The comparison was successful; the disks are the same
       goto exit
       :exit


 Related commands

    For information about comparing two files, see the comp(CMD) and fc(CMD)
    commands.


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026