Skip to content

pdengine.binary.patcher

Introduction

pdengine.binary.patcher or pdbp for short is a simple, straightforward binary patch creator and applicant, it finds differences between 2 given file-system directories on a per-byte level and creates a patch file, which can be applied on a "old" directory to make it equivalent to a "new"-er one.

This is especially useful for diff-based updates for medium to large-scaled software packages, especially for software that utilizes packaged binary formats, since a "diff" operation will take a considerably smaller amount of time to fulfill compared to having the end-user download the full-sized file again in its entirety.

With this, the only thing a end-user would require is the patch file itself, and access to this tool; While the patch file itself will only contain the diff data itself, nothing more.

This project is based on vcdiff, the zip standard implementation maintained by the dotnet team as part of .NET's standard library and the XXHash64 implementation by Milosz Krajewski.

Further dependencies are from the CommandLineParser project and MemoryPack

Features

  • Create small, compact patch-files representing the diffs of two given filesystem directories.
  • Robust backup systems (Compact, Full) modes available.
  • Add/Move/Ignore/Delete File operations supported.
  • Highly unit tested via xunit.

Commands: General

  • -v/verbose - Verbose mode (default).
  • -c/create - Create a patch.
  • -a/apply - Apply a patch.
  • -a/apply-backup - Apply a backup (compact only).

Commands: Patch Creation

  • -i/old-path - Old directory.
  • -n/new-path - New directory (old directory will become this upon patching).
  • -o/output - Output file path.
  • -g/ignore-file-path - A newline seperated file with relative paths (from the old directory root) to ignore.
  • -m/move-file-path - A newline seperated file with relative paths (from old directory root) to move; OLD=NEW Paths syntax.

Commands: Patch Application

  • -i/old-path - Old directory.
  • -p/patch-path - Patch file path.
  • -n/no-backup - Set backup creation flag.
  • -m/backup-mode - Set the backup mode (full, compact).
  • -b/backup-path - Set the backup output path.

Commands: Backup Application

  • -i/old-path - Old directory.
  • -p/patch-path - Patch file path (required only for compact mode).
  • -m/backup-mode - Specify the backup mode used initially for creation (full, compact).
  • -b/backup-path - Specify the backup output path.