CONTENTS | INDEX | PREV | NEXT
GCompare
GCompare is a shell command. The format is
GCompare <old file> <new file> <patch file> [MODE <n> [VARY <n>] | AUTO [DEEP]] [VERBOSE] [mem128 | mem256]
GCompare compares the old file with the new file and stores all changes in
the patch file.
If GCompare finds an existing patch file, then it appends the patches
after a check on whether the patch file do not contain already patches for
the old file.
If a patch file already exists, then GCompare searches for matching data
in this file too.
Later GPatch can build the new file using the old file and the patch file.
In case of errors GCompare displays an error message.
Any fatal error produces a return code of 15, and if the result is a corrupt
patch file then it will be deleted.
The options MODE, VARY, AUTO and DEEP select the operating mode.
Without any option GCompare works in its mode 3. This will
produce a useful result for all files.
With the option AUTO GCompare selects the optimal type. The additional
argument DEEP varies the value for the minimum size of matching data from
-1 to 1.
With AUTO DEEP GCompare produces the shortest possible patch file.
If you additional type the option VERBOSE then GCompare tells you the
settings for the best result after the compare passes.
With the option MODE you can select the file format immediately.
The MODE values <n> can be the numbers 1 to 4.
The option VARY changes the internal minimum values for accepting data
as match blocks (automatically tested in the DEEP mode). The minimum is -3.
With the option VERBOSE GCompare prints in all operating modes but AUTO
a detailed list of the patch data.
GCompare needs enough free memory for old file, new file and the patch file.
The search speed of GCompare depends now on the remaining memory.
The fastest search algorithm needs altogether 9 times the filesize of the
old file plus 128 MB.
The search algorithm based on a two-dimensional array needs altogether
9 times the filesize of the old file plus 514 KB. (This was the fastest
algorithm used in GCompare 2.)
The simple list search needs altogether 9 times the filesize of the
old file plus 2 KB.
If GCompare can not allocate this memory too, then it works in
the mode 3 using linear search.
For the search in the already existing patch file it is the same.
The fastest search needs 9 times the filesize of the patch file plus 128 MB,
the search by the two-dimenional array needs 9 times the filesize of the patch
file plus 514 KB and the simple search needs 9 times the filesize plus 2 KB.
If this memory is not available then GCompare searches only in the old file.
The options mem128 or mem256 prevent GCompare from using both
or one of the 128 MB search arrays. You need this on systems with virtual memory,
because the search algorithm works only fast using real memory.
So you should have more than 128 MB physical memory to build a new
patch file with the fast search algorithm. To append new patch data to an
existing patch file you should have more than 256 MB.
Example: If you want to append data to a patch file for an 100 KB file, using
a WinUAE machine with 256 MB RAM, then GCompare needs 129 MB for the fast search
in the file and additional 128 MB for the search in the patch file. The computer
has no 257 MB (running Windows, the emulator and AmigaOS the remaining memory is
approximately 200 MB) and the search would run partially in the virtual memory of
Windows. Therefore in this case you should use the option mem256. Then GCompare would
use the 128 MB array only for the search in the old file, the search in the
patch file would use a 512 KB array.