View Single Post
Old 06-03-2016, 08:46 AM   #11
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Using inotify is a bit tricky because of both the USBMS handling and the fuse layer proxy.
You basically have to watch out for unmounts, and re-create your watches when the userstore becomes available again (that takes care of the USBMS issue), and you have to setup your watches on base-us and not us (that takes care of the fuse proxy).

See the <K5 screensavers hack for an example. Which also bundles the required inotifywait tools.

See also the same basic principle on the other side of the fence for another example of how to deal with USBMS, in C this time.

Last edited by NiLuJe; 06-03-2016 at 08:49 AM.
NiLuJe is offline   Reply With Quote