fswatch icon indicating copy to clipboard operation
fswatch copied to clipboard

Add fanotify support

Open infectormp opened this issue 5 years ago • 5 comments

Linux Kernel 5.1 released and now it can handle all file events by fanotify https://github.com/amir73il/fsnotify-utils/wiki/Super-block-root-watch so fanotify support now can be added to fswatch

infectormp avatar May 14 '19 07:05 infectormp

What is the opinion of the maintainers on fanotify? It seems the next step.

According to the fanotify's author (here), it provides "the ability to set a single (fanotify) watch on a root directory and get notified on all the legacy inotify events without the need to recursively add watches on all directories."

It was partially merged on mainstream kernel 5.1 and fully merged on 5.9 onwards.

paulocoghi avatar Dec 23 '22 18:12 paulocoghi

Could we check the kernel version or the existence of fanotify and use it when available?

paulocoghi avatar Dec 23 '22 18:12 paulocoghi

You could probably copy/paste my implementation, or significant portions of it.

https://github.com/e-dant/watcher/blob/release/devel/include/detail/wtr/watcher/adapter/linux/fanotify/watch.hpp

I'm not aware of any other reasonable implementations on GitHub.

e-dant avatar Mar 02 '23 23:03 e-dant

There are a lot of... subtleties with getting fanotify running correctly. I hope there's enough documentation in there that you don't run into them yourself.

e-dant avatar Mar 02 '23 23:03 e-dant

@e-dant Wow! Your project is a gem among the many watchers out there! Not only in regard to the OS APIs used, but to the code organization, excellent documentation, automated tests and even a cache!

paulocoghi avatar Mar 03 '23 12:03 paulocoghi