Skip to content
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

Implement -samefile #19

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added check for different devices.
hanbings authored and sylvestre committed May 30, 2024
commit 47fce96694df01796e8619b6f0d626eaba479b1b
5 changes: 5 additions & 0 deletions src/find/matchers/samefile.rs
Original file line number Diff line number Diff line change
@@ -23,6 +23,11 @@ impl Matcher for SameFileMatcher {
#[cfg(unix)]
fn matches(&self, file_info: &walkdir::DirEntry, _matcher_io: &mut super::MatcherIO) -> bool {
let meta = file_info.metadata().unwrap();

if meta.dev() != self.metadata.dev() {
return false;
}

meta.ino() == self.metadata.ino()
}