Function fclones::dedupe [−][src]
pub fn dedupe<'a, I>(
groups: I,
op: DedupeOp,
config: &'a DedupeConfig,
log: &'a Log
) -> impl ParallelIterator<Item = FsCommand> + 'a where
I: IntoParallelIterator<Item = FileGroup<Path>> + 'a,
Expand description
Generates a list of commands that will remove the redundant files in the groups provided
by the groups
iterator.
Calling this is perfectly safe - the function does not perform any disk changes.
This function performs extensive checks if files can be removed. It rejects a group of files if:
- metadata of any files in the group cannot be read,
- any file in the group was modified after the
modified_before
configuration property
Additionally it will never emit commands to remove a file which:
- has length that does not match the file length recorded in the group metadata
- was matched by any of the
retain_path
orretain_name
patterns - was not matched by all
drop_path
anddrop_name
patterns
Parameters
groups
: iterator over groups of identical filesop
: what to do with duplicatesconfig
: controls which files from each group to remove / linklog
: logging target