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

FileConnect - Inotify for directory watching #72

Open
adrianfilip opened this issue Oct 7, 2022 · 4 comments
Open

FileConnect - Inotify for directory watching #72

adrianfilip opened this issue Oct 7, 2022 · 4 comments

Comments

@adrianfilip
Copy link
Contributor

adrianfilip commented Oct 7, 2022

The context is:

"
Does it manages inotify for directory watching? It's such a mess and jdk impl with its OVERFLOW is not helping, no more than not knowing when file is closed, I needed to implement smthg far too much complicated for a rather simple "watch for pair file+signature"

I mean, it remains understandable thanks to zio queue / cancellable effects / etc, but it horribly looks like a sausage factory internals in need for a good and robust api :)
"

@mtekp
Copy link

mtekp commented Oct 28, 2022

@adrianfilip will wrapping something like https://docs.rs/notify/5.0.0/notify/ through JNI calls and receiving events over zeromq or something like that help here? Or is there any specific thing which is required?

notify library when run through its example https://github.com/notify-rs/notify/blob/main/examples/monitor_raw.rs provides events like this

changed: Event { kind: Create(File), paths: ["/home/manjunath/eventTest/testFile"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }
changed: Event { kind: Modify(Metadata(Any)), paths: ["/home/manjunath/eventTest/testFile"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }
changed: Event { kind: Access(Close(Write)), paths: ["/home/manjunath/eventTest/testFile"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }
changed: Event { kind: Remove(File), paths: ["/home/manjunath/eventTest/testFile"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }

@adrianfilip
Copy link
Contributor Author

adrianfilip commented Oct 28, 2022

@mtekp I would look for libraries in the java space for this. If none are suitable maybe we need to develop something custom.

@irach-ramosh
Copy link
Contributor

irach-ramosh commented Oct 28, 2022

@adrianfilip
Can I try again with JDK ?

I think OVERFLOW event is not relevant in this case (we can stop watching the sub-directory on where this event occurs).

Why you need to know when a file is close for a directory watch ?

We are talking about watching all files in a directory tree recursively right ?

@adrianfilip
Copy link
Contributor Author

Let's leave this for now. I need to spec it out more, maybe reach out to the person that first raised it to get more feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

4 participants