Crate persist_if_changed

Source
Expand description

A tiny utility library to avoid touching the filesystem if the content has not changed.

This is useful to avoid triggering unnecessary rebuilds in systems that look at the modification time (mtime) as part of their file fingerprint (e.g. cargo).

Functionsยง

copy_if_changed
Only copy the file if its contents differ from the contents stored at the destination path.
has_changed_file2buffer
Returns true if the file contents are different, false otherwise.
has_changed_file2file
Returns true if the file contents are different, false otherwise.
persist_if_changed
Only persist the content if it differs from the one already on disk. It if the file does not exist, it will be created.