Skip to content

Consider implementing partial checksum #3

@imagejan

Description

@imagejan

Before deleting source files, we compare files by their os.stat() signature (filecmp.cmpfiles() with default shallow=True) here:

# and compare them (shallow).
(matches, _, _) = filecmp.cmpfiles(current_dir, dest_dir,
potential_matches)

This should be enough to also catch mismatches in creation dates (such as the 1980-01-01 ones created by Robocopy on incomplete files), but needs to be tested. We might want to offer an additional layer of safety.

Since comparing the full file contents (shallow=False) might decrease the performance too much, let's consider offering an option to compare partial checksum (e.g. on the first 128 kb) for each file, as suggested by @enricotagliavini.

/cc @lgelman

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions