Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought


     DISKCOMP(DOS)     UNIX System V      DISKCOMP(DOS)



     Name
          diskcomp - compares the contents of the disk in  the  source
          drive to the disk in the target drive


     Syntax
          diskcomp [drive:] [drive:] [/l] [/8]


     Description
          The first drive: option specifies the  drive  that  contains
          the  source disk, and the second drive: option specifies the
          drive that contains the target disk.

          If you specify only one drive,  diskcomp  uses  the  default
          drive as the target drive.  If you specify the same drive as
          the source and target, diskcomp does a comparison using  one
          drive, and prompts you to insert the disks as appropriate.

          The switches are:

          /l   Causes diskcomp to compare just the first side  of  the
               disk,  even  if the disks and drives that you are using
               are double-sided.

          /8   Causes diskcomp to compare just the first 8 sectors per
               track,  even  if  the disks contain 9 or 15 sectors per
               track.

          diskcomp performs a track-by-track comparison of the disks.
          It  automatically determines the number of sides and sectors
          per track based on the format of the source  disk.   If  the
          target  disk  is not the same type as the disk in the source
          drive, diskcomp displays the following message:

               Drive types or diskette types not compatible

          If all the tracks are the same,  diskcomp  displays  the
          message:

               Compare OK

          If  the  tracks  are not  the  same,  diskcomp  displays  a
          ``Compare  error''  message that includes the track and side
          number where it found the mismatch.

          When diskcomp completes the comparison, it prompts you with
          the following message:

               Compare another diskette (Y/N)?_

          If you enter y, diskcomp prompts you to insert the proper
          disks  and  does  the  next  comparison.   If  you  enter n,
          diskcomp ends.  If the disk in the default  drive  does  not
          contain  MS-DOS  and  you  end  diskcomp, you'll receive the
          following message:

               Insert disk with COMMAND.COM in drive A
               and strike any key when ready

          diskcomp does not work on network drives, and you cannot use
          it  with  assigned,  joined,  or substituted drives.  If you
          attempt to use diskcomp  with these types of drives, it
          displays an error message.

          diskcomp exit codes

          When correctly written programs exit back  to  MS-DOS,  they
          return  an  exit  code:  0  if no error occurred, or a value
          greater than zero if there was a problem.   This  exit  code
          can   be   tested  in  batch  files,  and  it  allows  batch
          programmers to ``branch'' to an  error-handling  routine  in
          the batch file.

          The diskcomp command returns the following exit codes:

          0   Compared OK            The disks compared exactly.

          1   Did not compare        The disks were not the same.
          2   CONTROL-C error        The user terminated with <CTL>c.

          3   Hard error             An unrecoverable read or write
                                     error occurred - did not
                                     compare.
          4   Initialization error   There is not enough memory -
                                     invalid drives or command line
                                     syntax.

          You can use the batch processing if command to perform error
          processing based on the errorlevel returned by diskcomp.


     Example
          If you want to compare two disks, but your computer has only
          one  floppy  disk  drive,  drive A, you can simply enter the
          following command:

               diskcomp a:

          MS-DOS prompts you to insert both disks, as required.


     Notes
          When comparing a disk with a backup disk that you made  with
          the  copy  command,  you  may  receive the ``Compare error''
          message, even if the files on the disks are identical.  This
          is  because the copy command duplicates the information, but
          doesn't necessarily place it in the  same  location  on  the
          target disk.

          diskcomp is an external command.


     DISKCOMP(DOS)        (printed 8/16/89)         DISKCOMP(DOS)

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