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
Dear Mr.Maezawa, Would you like to go to the Moon with me?
No matter if, i really respect your intentions behind th… https://t.co/ADrUynEWf4
3 days, 10 hours ago
Hon är vice statsminister. Jag tror inte hon har något val... https://t.co/sKIQqUDAyx
4 weeks, 1 day ago