The official XCOMP/2 home page

The XCOMP/2 home page

What is XCOMP/2

Welcome to the home of XCOMP/2, a recursive file compare utility. XCOMP/2 is for comparing files what is XCOPY is for copying files, something I was definitely missing in the OS/2 product.

When invoking XCOMP.EXE without commandline arguments, the help is displayed:

XCOMP/2 - The recursive file compare utility for OS/2, V2.50 (C) Roman Stangl 09, 2001 (Roman_Stangl@at.ibm.com) http://www.geocities.com/SiliconValley/Pines/7885/ Use the XCOMP command to selectively compare groups of files located in two directories, including all subdirectories. Syntax: XCOMP [drive:\|\\server\][path\]filename(s) [drive:\|\\server\]path [/MP] [/LOG[:[drive:\|\\server\][path\]filename]] [/!C] [/!F] [/TINY] [/LINE] [/SIMULATE] Where: [drive:\|\\server\][path\]filename(s) Specifies the location and name of the source file(s) to compare from. You may specify a fully qualified path or UNC path. [drive:\|\\server\]path Specifies the location of the destination path to compare with. You may specify a fully qualified path or UNC path. [/MP] Specifies that 1 thread reads the source and 1 thread reads the target file. This improves througput when comparing from 2 different physical drives (e.g. CD-ROM and Harddisk). [/LOG[:[drive:\|\\server\][path\]filename]] Specifies that XCOMP/2 logs all problems into a file specified either by this parameter, or by the XCOMP environment variable or into XCOMP.LOG (put into the directory XCOMP/2 was installed into) otherwise. [/!C] By default, XCOMP/2 pauses at all mismatches. Specifying this option allows XCOMP/2 just display the mismatch and continue the comparism without a pause (e.g. useful when using the /LOG option or output redirection). [/!F] By default, XCOMP/2 pauses for files in the source location that can't be found at the target location. Specifying this this option allows XCOMP/2 just display the miss and continue the comparism without a pause (e.g. useful when using the /LOG option or output redirection). [/TINY] 2 64kB buffers are used instead of a percentage of total RAM. [/LINE] Display line number information for messages (useful for e.g. debugging) [/SIMULATE] Does not compare the files (useful for e.g. just to list what files would be compared by checking their existance) Returns: 0 Successful completion 1 Files could not be opened to compare (possibly 0-length, locked or not existing) 2 Directories could not be opened to search for files (possibly access right or file system problems) 3 Directories could not be opened to search for directories possibly access right or file system problems) 4 A mismatch between at least 1 file was detected 100+ Fatal, unrecoverable exceptions XCOMP101: Too few commandline arguments specified.

Well, above explanation should be self explanatory. A sample run may output:

[0: H:\programming\xcomp]xcomp p:\notes\archivepsk* h:\notes\data\archives Comparing files qualified by archivepsk* at P:\notes\ with H:\notes\data\archives\ using 4194304 bytes buffer size ArchivePSK1998.nsf ArchivePSK1999.nsf ArchivePSK2000.nsf XCOMP030: Throughput Source 556kB/s, Destination 46247kB/s, Total 1064kB/s

One note about the line containing the Throughput measurements. In that example I was comparing some Lotus Notes databases on a backup CD-RW with the orignal on a harddisk. You can see that the Source drive, a CD-ROM drive, delivers a not too high throughput (it seems that that this 8-16 speed CD-ROM drive isn't too comfortable reading CD-RWs), while the Target drive, a Ultra-Wide SCSI drive delivers excellent performance (ok, actually it's the HPFS386 cache ;-) giving an acceptable Total performance.

The performance given for Source and Destination is just the raw performance of the OS/2 DosRead() API without accounting for overhead like doing the file searched and the comparism itself. The Total performance does include all overhead, that is the timer is started when the first file is searched and stopped when all files have been compared. Thus, don't take the performance specified to serious!

If the Source and Destination drives are different physical drives you may reduce the run-time by specifying the option /MP. Using that option causes 2 threads to be used for reading the Source and Destination files simultaneously instead of doing that sequentially with a single thread.
This option is most useful when reading from 2 drives of similar speed e.g. a CD-ROM and a CD-RW drive (because the 2 slow accesses will be done in parallel instead of sequential), it's less useful when having drives with a great difference in speed (because reading the fast drive takes almost no time compared to reading the slow drive, thus the slow drive alone affects the overall performance).

Use the option /!C if you do not want the comparism to stop waiting for the user pressing a key for every miscompare. This option may only be useful when you use the /LOG option or redirect the output into a file, as otherwise the lines stating the miscompare scroll away too fast.

Use the option /!F if you do not want the comparism to stop whenever a file in the source location can not be found in the target location. This option may only be useful when you use the /LOG option or redirect the output into a file, as otherwise the lines stating the miscompare scroll away too fast.

You may also notice that you may have a different buffer size. This is normal, because XComp/2 takes the amount of physical memory into account to be efficient on one hand and to limit swapping on the other hand. Using the option /TINY XComp/2 will use 2 64kB buffers instead of a percentage of the RAM installed. This might be useful if you are running a memory constraint system.

Finally, to ensure that you can notice the progress, a percentage indicator will be displayed while comparing files that are larger than the given buffer size.

If you just want to see if all files exists without actually comparing them (thus saving much time for the price of possibly overlooking corrupt data), then invoke XComp/2 with the /SIMULATE option.

When comparing using CD, CD-R or CR-RW media, you may get alarmed by miscompares which disappear when running the same (or limited to a subdirectory only) comparism again. I'm not sure what causes that, but I suspect that misreads of the drive (e.g. weak bits) occured. Reading the same files again may just cause different read results due to the drive's head repositioning in a different way.

Examples

As with V2.00 the interpretation of the commandline arguments regarding the source and target paths became more intelligent, here are some examples on the usage (we are located at S:\Orig and have XCOPY'd all files from there into T:\Copy):

Command
Resulting comparism from XCOMP/2
XCOMP S:\Orig\* T:\Copy Comparing files qualified by * at S:\Orig\ with T:\Copy\ using 2097152 bytes buffer size The most trivial example using 2 fully qualified paths. Specifying the qualified filename with "*" could of course be replaced with one actually wants to compare, e.g. "*.ba*" or "????.ba?"
XCOMP S:\Orig\ T:\Copy Comparing files qualified by * at S:\Orig\ with T:\Copy\ using 2097152 bytes buffer size If you do not qualify the filenames to compare for the source, by default "*" is assumed.
XCOMP * T:\Copy Comparing files qualified by * at S:\Orig\ with T:\Copy\ using 2097152 bytes buffer size The source "*" is expanded to a fully qualified path by querying the current directory.
XCOMP . T: Comparing files qualified by * at S:\Orig\ with T:\Copy\ using 2097152 bytes buffer size If you specify a relative path like ".", it is expanded to a fully qualified path.
As no qualified filename is specified too, "*" is assumed. Using ".*" instead would have avoided that assumption.
As no directory is specified for the target path, the current directory on that drive is assumed. Having specified "T:." would have led to the same result.
XCOMP S: T: Comparing files qualified by * at S:\Orig\ with T:\Copy\ using 2097152 bytes buffer size As you didn't specify a path, the current directories "S:\Orig" and "T:\Copy" will be taken automatically.
As no qualified filename is specified too, "*" is assumed.
XCOMP ..\Orig\ T:..\Copy Comparing files qualified by * at S:\Orig\ with T:\Copy\ using 2097152 bytes buffer size The relative path "..\Orig\" is expanded to "S:\Orig\" and as no qualified filenames are specified "*" is assumed.
The same applies to "T:..\Copy" which gets expanded to "T:\Copy\*".
XCOMP \\pka1002s\Orig\ \\pka1002d\Copy Comparing files qualified by * at \\pka1002s\Orig\ with \\pka1002d\Copy\ using 2097152 bytes buffer size For UNC-Names, things are treated the same way, e.g. as no qualified filename is available here, "*" is assumed.

If you found any inconsistency please tell me (it's not trivial to guess what the user may have meant when not specifying fully qualified paths)!

Verifying burned CD-R's and CD-RW's

As said, my primary motivation to write XCOMP/2 was to compare what has been burned onto a CD-R or CD-RW with the original data, as I do not trust write operations that have no explicit verification, e.g even if it takes some time I do verify the data when copying something to a floppy disk media.

And from my personal experience I'm right being sceptical here. I already have encountered a few CD-Rs and CD-RWs that contained currupted data. I have seen effects that best can be described as weak bits, which used to be a copy-protection mechanism for games on floppy disks. Weak bits are bits read from a media sometimes incorrectly and sometimes correctly, and that rate may even be different between different CD-ROM drives.

The technical reasons seem to be (and looking around in the Internet confirms that):

Considering all that, I'm quite sure that one should spend the short time required to verify what has been put onto a CD-R or CD-RW. For important data that is not easily reproducably I recommend even to burn at least 2 copies.

What's new

The following items have changed between V2.50 and its predecessor 2.40:

The following items have changed between V2.40 and its predecessor 2.30:

The following items have changed between V2.30 and its predecessor 2.20: The following items have changed between V2.20 and its predecessor 2.10: The following items have changed between V2.10 and its predecessor 2.01: The following items have changed between V2.01 and its predecessor 2.00: The following items have changed between V2.00 and its predecessor 1.50:

XCOMP/2 download

You are welcome to download XCOMP/2 V2.50 (inclusive its source written with VisualAge C++) from this site.

XCOMP/2 source code

XComp/2 includes the complete source code to recompile it. Just run Protect xcomp2v250 Source.zie to obtain the source code archive Source.zip out of the encrypted file Source.zie (in case you wonder why I'm not using e.g. password protected ZIP-files, well by the required proprietary decryptor only for the OS/2 platform, all people interested in the source need to obtain an OS/2 machine!). Then just unzip Source.zip, preferably at the path you want to compile XComp/2 from.

To compile XComp/2 for OS/2 you need:

To compile XComp/2 for WIN32 you need:


(C) Roman Stangl (Roman_Stangl@at.ibm.com), 18.07.2000
Last update: 10.09.2001