-
-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore duplicates if those are hard links #234
Conversation
4ffe4ae
to
2669688
Compare
czkawka_core/src/duplicate.rs
Outdated
let dups = self.filter_hard_links(vec_file_entry); | ||
if dups.len() > 1 { | ||
self.files_with_identical_hashes.entry(size).or_insert_with(Vec::new); | ||
self.files_with_identical_hashes.get_mut(&size).unwrap().push(vec_file_entry); | ||
self.files_with_identical_hashes.get_mut(&size).unwrap().push(dups); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be moved into check_file_size
function, because for now this only works for full file hashing and checking files before hashing will allow to drop some records before doing such resource heavy operation.
Thanks for this improvement, I guess it would be also nice to choose whether it will be ignored or not. |
f7efde7
to
ba705df
Compare
This is a proof of concept. ``` $ echo a > hardlinks/a $ cp hardlinks/{a,b} $ ln hardlinks/{a,c} $ cargo run --bin czkawka_cli dup -m 1 --directories $(pwd)/hardlinks -f /dev/stderr > /dev/null -------------------------------------------------Files with same hashes------------------------------------------------- Found 1 duplicated files which in 1 groups which takes 2 B. ---- Size 2 B (2) - 2 files /home/thomas/Development/czkawka/hardlinks/a /home/thomas/Development/czkawka/hardlinks/b ``` Open: - Windows support - Probably this should be a cli option
Thanks! |
This is a proof of concept. ``` $ echo a > hardlinks/a $ cp hardlinks/{a,b} $ ln hardlinks/{a,c} $ cargo run --bin czkawka_cli dup -m 1 --directories $(pwd)/hardlinks -f /dev/stderr > /dev/null -------------------------------------------------Files with same hashes------------------------------------------------- Found 1 duplicated files which in 1 groups which takes 2 B. ---- Size 2 B (2) - 2 files /home/thomas/Development/czkawka/hardlinks/a /home/thomas/Development/czkawka/hardlinks/b ``` Open: - Windows support - Probably this should be a cli option
This is a proof of concept.
Open: