All of the code examples for inotify do something like this: So presumably this allows for a single read() call to return up to 1024 events. What if there are actually more events than that in the queue? Will inotify guarantee to return a whole number of events, even if that means a short read? Or will inotify split an
Tag: inotify
can multiple scripts use inotifywait to watch the same file simultaneously?
Is there anything about the nature of inotify’s inotifywait that would result in unpredictable behavior (or predictable problems) when running two or more scripts that each uses inotifywait to watch the same file or set of files? Or is it safe/ok, technically, to have multiple scripts using inotifywait on the same files? Answer Yes, it is safe. inotify is a
How to stop the repetition of inotify result?
In this code, I am trying to monitor two paths at the same time. I used while(1) for this purpose. But the problem that I am facing is that whenever I run the code, it gives me the same result two times like this. Giving result Expected result I debugged the code. After breaking the main function and stepping over
inotify_add_watch relative to O_PATH dirfd
I am trying to call inotify_add_watch to watch a file. I would like to specify the file relative to an O_PATH | O_DIRECTORY file descriptor, a la symlinkat, fstatat, or openat. Is this possible? It doesn’t look like it is. Anyone know of a workaround? EDIT The closest thing seems to be the “trick” described at man 2 open under
questions about implementing pyinotify instance to monitor directory
I have some basic questions about pyinotify that I can’t seem to find the answers to elsewhere. 1) For a continuous directory monitor (and event processor) is it necessary to have a while( True ) loop or is the continuous event ‘loop’ handled by the notify watch and ended when I remove the watch? 2) What happens if files are