This archive contains two main products: the fileCompare program, and the replaceIfDifferent script. ***************** * FILECOMPARE * ************************** FileCompare determines whether two files have identical contents. Usage: fileCompare oneFile anotherFile. Returns: OK status (0) if both files exist and have identical contents WARN status (5) if both files exist but have different contents ERROR status (10) if either file doesn't exist FAIL status (20) if something horrible happens, like identical block read operations on files of supposedly equal sizes returning different quantities of data FileCompare is `pure' code, and may be made resident. This operation is becoming more useful now that compilers can be coaxed into generating function prototype files for all the functions in an xxx.c source file. A makefile that attempts to automate such prototype generation would show the "xxx.protos" as being dependent on "xxx.c", and (one way or another), vice-versa. Since make is unable to gague the magnitude of changes, it will dutifully re-extract the function prototypes whenever there is a change, however slight, in the associated source file. And then, since a new prototype file HAS been generated, all files listed as dependents on the prototype will have to be recompiled. One easy way out of this difficulty is to have the prototypes generated in a "temporary" file, which is then compared against the "official" prototype file. Only if the new prototype file is actually *different* does it replace the old copy. ***************** * REPLACEIFDIFFERENT * ************************ A file comparison utility, by itself, is not sufficient to support the kind of makefile described above; at least, not for the version of make I use (the one that came with my Manx Aztec C compiler). Unfortunately, the commands this make allows are limited to legal AmigaDOS commands, which means that no conditional testing and branching is possible among the commands that make will run when it's trying to build a target. I've written a script called "replaceIfDifferent" (AmigaDOS Execute scripts are the only places where the testing & branching operations if, then, else, etc. work). This script will run the fileCompare program on a pair of files specified as arguments to the script, and replaces the second file with the first one, in the event that they are different.