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.