notify-rs / notify

🔭 Cross-platform filesystem notification library for Rust.
https://docs.rs/notify
2.77k stars 222 forks source link

Support watching the same inode through multiple paths. #573

Open hugwijst opened 8 months ago

hugwijst commented 8 months ago

Support watching the same inode through multiple paths.

As a single change event can now refer to multiple paths, use "path groups" for renames to differentiate sources and destinations.

Fixes #572.

hugwijst commented 7 months ago

Ping @dfaust, @0xpr03. I'm wondering if there is a less intrusive solution?

hugwijst commented 3 months ago

Ping @passcod, @dfaust, @0xpr03, would any of you be able to review?

The current implementation is buggy if the watched directory contains two hard or symbolic links to the same file. I can see an argument for symbolic links to not be followed at all, but something like this change is needed for hard links I think.

hugwijst commented 3 months ago

After revisiting this PR I think the ignoring symlink while walking the directories is the better solution to my problem: #635. Some of the changes here might still be useful to handle hardlinks.