- Noter
Compares the contents of two files or sets of files byte by byte.
COMP can compare files on the same drive or on different drives, in
the same directory or in different directories. As COMP compares the
files, it displays their locations and filenames.
SYNTAX
------
COMP [data1] [data2] [/D] [/A] [/L] [/N=number] [/C]
PARAMETERS
----------
data1
Specifies the location and name of the first file or set of files
you want to compare. You can use wildcards (* and ?) to specify
multiple files.
data2
Specifies the location and name of the second file or set of files
you want to compare. You can use wildcards (* and ?) to specify
multiple files.
SWITCHES
--------
/D
Displays differences in decimal format. (The default format is
hexadecimal.)
/A
Displays differences as characters.
/L
Displays the number of the line on which a difference occurs,
instead of displaying the byte offset.
/N=number
Compares the first number of lines of both files, even if the
files are different sizes.
/C
Performs a comparison that is not case-sensitive.
NOTES
-----
Comparing files with the same names
-----------------------------------
The files you want to compare can have the same filename, provided
they are in different directories or on different drives. If you do
not specify a filename for data2, the default filename for data2 is
the same as the filename in data1. You can use wildcards (* and ?)
to specify filenames.
Special cases for data1 and data2
---------------------------------
If you omit necessary components of either data1 or data2 or if you
omit data2, COMP prompts you for the missing information. If data1
contains only a drive letter or a directory name with no filename,
the default filename for data1 is *.*. Therefore, COMP compares all
the files in the specified directory to the file specified in data2.
If data2 contains only a drive letter or a directory name, the
default filename for data2 is the same as that in data1.
How the COMP command identifies mismatching information
-------------------------------------------------------
During the comparison, COMP displays messages to identify the
locations of unequal information in the two files. Each message
indicates the offset memory address of the unequal bytes and the
contents of the bytes themselves (in hexadecimal notation unless
you specify the /A or /D switch). The message has the following
format:
Compare error at OFFSET xxxxxxxx
file1 = xx
file2 = xx
After 10 unequal comparisons, COMP stops comparing the files and
displays the following message:
10 Mismatches ending compare
Comparing files of different sizes
----------------------------------
You cannot compare files of different sizes unless you specify the
/N switch. If the file sizes are different, COMP displays the
following message:
Files are different sizes
Compare more files (Y/N)?
Press Y to compare another pair of files. Press N to stop the COMP
command.
If you press Y in response to the prompt, COMP includes any switches
you specified on the command line in every comparison it makes,
until you press N or retype the command.
When comparing files of different sizes, use the /N switch to
compare only the first portion of each file.
Comparing files sequentially
----------------------------
If you use wildcards to specify multiple files, COMP finds the first
file matching data1 and compares it with the corresponding file in
data2, if it exists. COMP reports the results of the comparison,
then does the same for each file matching data1. When finished,
COMP displays the following message:
Compare more files (Y/N)?
To compare more files, press Y. COMP prompts you for the locations
and names of the new files. To stop the comparisons, press N. When
you press Y, COMP prompts you for switches to use. If you don't
specify any switches, COMP uses the ones you specified before.
If COMP cannot find the files
-----------------------------
If COMP cannot find the file(s) you specify, it prompts you with a
message to determine whether you want to compare more files.