The official XCOMP/2 (WIN32 port) home page

The XCOMP/2 (WIN32 port) home page

XCOMP/2 on WIN32

As far as I can tell, XComp/2 for WIN32 should behave the same between OS/2 and WIN32, though due to the different APIs there, there might be incompatibilities I'm certainly interested in hearing about.

I did the port under NT4 SP5, and though I was using the oldest version of the APIs that should be available under WIN9x too, there is no guarantee that XComp/2 will really work there. As always, Microsoft's inflation of APIs for different versions of Windows is a hell, and shows that due to their monopoly they can force what they want, and whatever they do looks shortsighted!

The only visible difference is the logo displayed when invoking XComp/2:

XCOMP/2 - The recursive file compare utility for OS/2 (WIN32 port), V3.10 (C) Roman Stangl 05, 2002 (Roman_Stangl@at.ibm.com) http://geocities.datacellar.net/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\]file]] [/!C] [/!F] [/!S] [/!B] [/P] [/TINY] [/LINE] [/SIMULATE] [/CHK:[drive:\|\\server\][path\]file] 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 Target 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\]file]] 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 comparison 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 comparison without a pause (e.g. useful when using the /LOG option or output redirection). [/!S] By default, XCOMP/2 recurses into all subdirectories it finds, specifying this option prevents XCOMP/2 doing that. [/!B] By default, XCOMP/2 will beep, when a severe error occurs accessing a file at the source or target location. Specifying this option will silence XCOMP/2 (e.g. useful when using the /LOG option or output redirection). [/P] Request XCOMP/2 to pause when it has finished. [/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) [/CHK:[drive:\|\\server\][path\]file] Specifies that XCOMP/2 uses a checksum file to ensure data integrity. If the checksum file does not exist, it will be created, otherwise compared with the checksum calculated from the data read from the Source. When using the extension ".MD5" is used, the checksum file will be compatible to the MD5SUM utility. You may need the option /!S additionally, as MD5SUM ignores subdirectories. 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 5 A mismatch between the calculated Checksum and the recorded one in the Checksum file of at least 1 file was detected 100+ Fatal, unrecoverable exceptions XCOMP101: Too few commandline arguments specified.

Porting to WIN32

Because I was in a masochisitic mood, I started to port the OS/2 code to the WIN32 platform (done under NT4, but I would not know why the port shouldn't work under the gaming OS's WIN95 and above too). After about 12 hours or so (without having done anything specific for the WIN32 API before) the horror was over and the port seems to be working.

As I almost expected, it really was some kind of horror adventure even though I also used IBM's VisualAge C++ compiler so that at least the non-OS/2 C++ stuff shouldn't cause headaches. Anyway, after that experience I am reconfirmed that it is a pleasure to develop under OS/2 compared to WIN32, because:

Well, meanwhile I had the chance to play a little with MS VisualStudio C++ 6, and of course some observations:

Results

Once again, it's clearly to demonstrate that OS/2 is the superior platform and one gets only even more disappointed that IBM lost interest to compete with that inferior monopolistic evil empire (it won't bring back OS/2, but one can at least hope that switching to Windows makes things much more expensive, unreliable and insecure, so we got at least something to laugh about).

I haven't really looked into LINUX programming, but have bought the book Linux Application Development because it was heavily recommended everywhere. After reading it I really was very disappointed (or maybe I did not understand what this book was written for), because it did spent a lot of time talking about terminals and so, but not or just on the surface talking about queues, semaphores, multithreading, ... all the stuff needed to make good programs :-(.

The SYS executable

During XComp/2 porting on WIN32 I had to struggle with API return codes as many APIs provide the same as OS/2 (even the macro reads the same) while others provide different (it seems to me that OS/2 has a finer resolution when providing error codes) return codes. As translating the return codes into something one can find out its cause, I have written Sys.c which returns the text corresponding to the return code (as the MS SDK help proved helpless and the header files are too incomplete again).

It's similar what you can receive under OS/2 when typing HELP SYSx where x is the return code, except that under OS/2 you also get some information how to cure the problem. Just type SYS to get some basic help:

SYS - Windows error code retriever for WIN32, V1.00 (C) Roman Stangl 09, 2001 (Roman_Stangl@at.ibm.com) http://geocities.datacellar.net/SiliconValley/Pines/7885/ Syntax: SYS x Where: x ... Numeric Windows system error code Or type SYS x where x is the API return code, e.g. 32: SYS32: The process cannot access the file because it is being used by another process.

By the way, this utility can also be helpful when XComp/2 does complain and show error codes during comparison to find out the cause (e.g. XComp/2 will just tell SYS32 when you try to compare PAGEFILE.SYS, because the Windows swapper is locked by the system as SYS 32 will tell you).

Accessing XComp/2 for WIN32

The port XComp/2 to windows is part of the XComp/2 source code archive, both for the modified source code and the exectuable itself.

Note: You have to have access to an OS/2 PC to decrypt the encrypted source code archive, because I provide the decryption executable only for OS/2. These tools are for OS/2 users who are forced to used Windows sometimes, but not for users that uncritically help to extend the power of the evil's empire monopoly!


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