Thank you On Fri, 23 May 2025 at 16:52, Didier Kryn <[email protected]> wrote:
> Le 23/05/2025 à 13:10, Laurent Bercot a écrit : > > Second thing: last time I checked, you could not use inotify on > > sysfs to watch for file creation. Has it changed? If it has, it's > > awesome, but it would only work on recent kernels, so unfortunately > > that's not usable on a generic distribution (unless they stick to very > > recent kernels). > > Hi. I'm just lurking on Skarnet, but I could comment on this remark > about inotify. > > It's actually too bad that inotify doesn't work on sysfs and > procfs. But there is an alternative method for an application to wake on > asynchronous modification of a file, though I don't think it is > available in a script. > > If you watch /proc/self/mountinfo with select() for exceptional > conditions (exceptfds, in the man page), you get an event whenever the > file is modified. One might imagine that a directory could be watched > the same way for file creation/deletion. I don't know, though, if this > property of /proc/self/mountinfo can be generalized and if it works for > directories and for sysfs, but it is something which might be explored > if the problem is critical. > > -- Didier > > >
