Function hashdeep_compare::partition::partition_log[][src]

pub fn partition_log(
    filename1: &str,
    filename2: &str,
    output_filename_base: &str
) -> Result<PartitionLogSuccess, Box<dyn Error>>
Expand description

Partitions entries from two hashdeep logs by content and name matches.

hashdeep logs are loaded from filename1 and filename2, and output groups are based on the output_filename_base path prefix.

Entries in the loaded logs will be grouped in this order:

  1. full match
    1. 1 in each file: no change between logs
    2. anomalies (invalid file)
  2. only name match
    1. 1 in each file: file content changed between logs
    2. anomalies (invalid file)
  3. only content match
    1. 1 in each file: file moved/renamed between logs
    2. match groups (unknown cause)
  4. no match (listed by origin)

Each log entry is guaranteed to be represented in exactly one group.

On success, returns a statistics string about the successful operation, plus warning strings if any were emitted while loading the hashdeep logs.

Errors

Any error emitted while reading or writing the files will be returned.

An integrity check is run on the partitioning results after calculation: an error will be emitted if this fails (this is extremely unlikely).