[conspire] How reliable is inotifywait?

Nick Moffitt nick at zork.net
Tue Mar 12 04:11:44 PDT 2024


On 10Mar2024 06:06pm (-0400), Steve Litt wrote:
> The inotifywait program waits until a specific file event happens in a
> specific directory or file, and then terminates. So it enables
> file-driven event driven programs.
[...]
> I can significantly simplify my program if I changed -t 30 to t -1,
> where -1 stands for "forever". False positives aren't a problem: They
> would just start another cycle. But false negatives, where a file is
> created or moved into /tmp/pager but fails to quit and terminate, would
> really mess me up in this particular situation.
> 
> So what do you think, is inotifywait reliable?

inotifywait uses the kernel's inotify interface, which has been around for a couple decades now.  It's *definitely* more reliable than a script polling filesystem state in a loop, and absolutely more resource-efficient.

I strongly suspect that for your use case, inotify will be one of the most reliable parts of your system.



More information about the conspire mailing list