Patchfile

class Patchfile

Inheritance diagram

digraph inheritance4ec7e5b9d7 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "Patchfile" [URL="acron.core.Patchfile.html#acron.core.Patchfile",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "Patchfile" [arrowsize=0.75,style=""]; }
Patchfile.__init__()

Create a patch file and initializes internal data

Create patch file with buffer to patch

Patchfile.apply()

Patches the entire file in one call returns true on success and false on error

This version will delete the patch file and overwrite the original file.

Patches the entire file in one call returns true on success and false on error

This version will not delete any files.

Patchfile.build()

This implementation uses the “greedy differencing algorithm” described in the masters thesis “Differential Compression: A Generalized Solution for Binary Files” by Randal C. Burns (p.13). For an original file of size M and a new file of size N, this algorithm is O(M) in space and O(M*N) (worst- case) in time. return false on error

Patchfile.get_allow_multifile()

See set_allow_multifile().

Patchfile.get_footprint_length()
Patchfile.get_progress()

Returns a value in the range 0..1, representing the amount of progress through the patchfile, during a session.

Patchfile.get_result_hash()

Returns the MD5 hash for the file after the patch has been applied.

Patchfile.get_source_hash()

Returns the MD5 hash for the source file.

Patchfile.has_source_hash()

Returns true if the MD5 hash for the source file is known. (Some early versions of the patch file did not store this information.)

Patchfile.initiate()

Set up to apply the patch to the file (original file and patch are destroyed in the process).

Set up to apply the patch to the file. In this form, neither the original file nor the patch file are destroyed.

Patchfile.read_header()

Opens the patch file for reading, and gets the header information from the file but does not begin to do any real work. This can be used to query the data stored in the patch.

Patchfile.reset_footprint_length()
Patchfile.run()

Perform one buffer’s worth of patching. Returns one of the following values:

  • EU_ok : while patching

  • EU_success : when done

  • EU_error_abort : Patching has not been initiated

  • EU_error_file_invalid : file is corrupted

  • EU_error_invalid_checksum : incompatible patch file

  • EU_error_write_file_rename : could not rename file

Patchfile.set_allow_multifile()

If this flag is set true, the Patchfile will make a special case for patching Acron Multifiles, if detected, and attempt to patch them on a subfile-by-subfile basis. If this flag is false, the Patchfile will always patch the file on a full-file basis.

This has effect only when building patches; it is not used for applying patches.

Patchfile.set_footprint_length()