When I was googling for this it was quite to hard to find so I thought I'd share. /proc/mounts doesn't publish a stream of events or something like that, the trick is to put the file in the "exceptfds" field. A "special exception" is triggered when it's updated and you can read it from scratch.
f = open("/proc/mounts")
r,w,x = select.select(,,[f])
Of course this can be combined with select/epoll on other fds if you actually look at the return value. :-)Share on Twitter Share on Facebook
C lets you shoot yourself in the foot. C++ lets you shoot yourself in the face. Static analysis just alerts you tha… https://t.co/ND9ekXI22Q
1 day, 1 hour ago
@michaellarabel so... it's out! :-)
1 day, 5 hours ago