GCompare / GPatch 2.0 --------------------- Author: Ralf Gruner, An der Sense 5a, D-02779 Großschönau, Germany ralf.gruner@t-online.de GCompare generates patch files for the distribution of updates for any files. GPatch applies these patches. I know that there are already exist patch generators for Amiga. But when I begun to work on GPatch I was not yet owner of SAS C (and scompare), and the freeware version I found in Aminet crashes my machine. So I have written a new patcher. The features are: ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ -The patch file can contain patches for any number of files. So you can distribute the update for a lot of versions in one file. If the directory structure of your product is unchanged, then the patcher will find the required patches without any additional actions of your update script. And you can put the patches for different files of your product in one patch file. -The format of the patchfile is very high optimized. GCompare tries some different coding algorithms and selects that with the shortest result. I do not know too many similar programs, but I think in the most cases GCompare produces the shortest patch files of all available patch programs. -To avoid corrupt files, the programs contain a very safe error checking (CRC32 signatures for all files). So you can be sure that the result of the patch process is perfect if no error messages appear. Usage: ŻŻŻŻŻŻ GCompare and GPatch are shell commands. Syntax: GCompare [mode ] [quick] GPatch If GCompare finds an existing , then it appends the patches. GPatch selects the matching patches by file size and CRC signature. If the output contains no error messages, then the actions were successful. Any fatal error produces a return code greater than 10. You can use the options "mode" and "quick" to select an operating mode: Without these options GCompare selects the optimal type. With the option "mode" you can select it and "quick" is a fast mode for very large files. The mode values can be the numbers 1 to 4. GCompare needs enough free memory for old file, new file and the patch file. If GCompare can not allocate enough memory for the list search algorithm (10 times the filesize of the old file), then it uses the mode 3 (needs only linear search). As GCompare example I have included scripts for a fictive program. The old versions of this program "MyProgram" are in "Archive". The patches for the program and a manual "MyProgram.readme" will be applied on the distribution disk "MyProgram". Discussion and hints: ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ I have got some mail about the speed and the size of the resulting patch file. Some of you found the patch file size much shorter than of other patchers, some of you not, and all want a faster compare program. Because it is impossible to develop a format of the patch file with always the shortest result (because the file size depends on the distance of the matching data and the way to address it) GCompare has four algorithms. The optimizer selects the best format, but this takes four times of computing time. If you want not wait for the optimizer then you can select the file format with the "mode" argument. In the most cases "mode 1" provides a good result. If for very large files GCompare needs too much time then you can use "mode 3". The argument "quick" is for the fastest search, but then the patch file will be larger. If you compare the results of GCompare with the results of other programs, you should do this with compressed versions of the patch files too. GCompare has no built in compression (different from other compare programs with run length encoding), because I think all distribution files will always be compressed before they are published. There is really no chance to make GCompare much faster. GCompare searches matching data in the entire old file (and not only in a relative area like other compare programs). If you have not enough time, I suggest you to use the quick mode. Distribution: ŻŻŻŻŻŻŻŻŻŻŻŻŻ GCompare and GPatch are freeware programs. You can use it for all your needs without restrictions. Also use for commercial products is free. If you want to see future updates of the programs, please send me an email that you use the programs. There are some things to improve yet, but if nobody need them I can do other things. Any comments are welcome. Ralf ----------------- Disclaimer ŻŻŻŻŻŻŻŻŻŻ THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THOUGH EVERY CARE HAS BEEN TAKEN TO MAKE THIS PROGRAM SYSTEM-FRIENDLY AND BUGS-FREE, THE ENTIRE RISK AS TO THE RESULTS, RELIABILITY AND PERFORMANCE OF THIS PROGRAM IS ASSUMED BY YOU. ----------------- History: ŻŻŻŻŻŻŻŻ 19.04.97: GCompare 1.0 / GPatch 1.0 Inital release. 21.04.97: GCompare 1.1 / GPatch 1.1 Bugfix. Better examples. 26.04.97: GCompare 1.2 / GPatch 1.2 Speed improvements. 01.05.97: GCompare 1.3 / GPatch 1.3 Bugfix (GPatch failed on the most files greater than 64KB). 11.05.97: GCompare 1.4 / GPatch 1.4 GCompare uses a faster search algorithm. 01.06.97: GCompare 1.5 / GPatch 1.5 New file format (shorter patch files). Some small changes. 05.07.97: GCompare 1.6 / GPatch 1.6 Bugfix: Possible counter overflow with large data blocks. 23.11.97: GCompare 2.0 / GPatch 2.0 File size limit increased (from 8MB to 2GB). Three new coding algorithms. GCompare uses an optimizer for best results. Compiled with SAS/C 6.58 now - 20% shorter and 5% faster.