File and Directory Targets

GenPatch allows you to create two different types of patches.

The so-called "File Patch" will change one single file on the end user's computer and no more. Oftentimes, however, you will want to change more than a single file. You can do this by creating a "Directory Patch".

Although the later sounds more complicated, creating both them is equally simple to do with BinPatch. Just select directories as start and end states for you patch if you want to update a directory and files if you want to update files GenPatch checks if all files are of the same type (mixing directories and files will lead to an error report) and creates the appropriate type of patch file for you.

When GenPatch handles directories it scans the directories given and creates fingerprints of all files found. You can make this scan ignore files by pattern if you have files in the directory that should be ignored.

Then the "Auto-detection" is performed. It analyses the fingerprints to find the matching files. This step is not based on matching filenames, but purely on the contents of the files. One exception though. If a filename exists identically, we chose to default to using exactly that file as a start state and apply the content related Auto-detection only if no such file exists. This gives the same result for any reasonable update situation, but may make the procedure much faster with very large amounts of files. If you think, you may have a situation where files swapped filenames and the GenPatch should do a full Auto-detection, you may use the option "-autodetection-full" (not yet implemented) to disable this bias.

If you find the very rare case that GenPatch fails to select a correct start state or that the start state should not be used for some reason, you can restrict the auto-detection to comply with patterns.

Another issue with directories will be that not all files ought to be required to successfully update. Think of "readme" files that the end user has deleted on his machine. By default patch files require that all files can be created, or otherwise the patch will not be applied. But you can specify files that should be tolerated to fail to weaken this requirement.

And another issue with be to check the presence of files without touching them. This can be accomplished using a trick and forcing identical files to be patched. If you don't tolerate to fail in updating a file from itself to itself, you perform a version and existence check of this file.