Turns out inotify sucks imho.
Theres a number of competing systems for 'filesystem change monitoring', and it seems to vary wildly. When I first started hacking on libpnd, INOTIFY did not have the signalling version, so you had to poll inotify (very low load, a select() and block really), whereas now you can get a kick when something changes. But even then, INOTIFY seems not to work for a lot of things you should think .. be it desktop or on pandora. ie: You have it watch a directory for file creation, and then mount something with UDEV creating the dir-mount-point in the watched dir.... inotify won't catch that. Inotify is a pita for making recursive watches in (even when you do depth-first watch-setup). Now, some of that may have been to the particular version of inotify in the kernle we were using a year ago (much has changed!), but I had a lot of hairpulling where inotify just didn't do useful shit (or 'seemed to', but didn't.)
In the end, what it does is two-fold..
1) inotify to watch for normal file activity (you move a pnd from here to there, deal with it.) It uses a very light polling, as above. ie: Its not sit and spin, but its checking every 5s with a select() type thing IIRC. You can't "block forever" and wait, withotu getting really smart in the code. (ie: I ran into a thing where you'd inotify watch on a bunch of directories, and then somethign would change, and you'g get hundreds or thousands of notifications in a single instant, and sometimes oyu'd get htem spread over like 10s .. so you'd be reacitng to a notification while mor still coming, creating never ending loops, etc.) So I put in some cheesy little easy things that work really nicely, but inotify is basicly sort of annoying. At least the inotify version I was using at the time, and the code has stood and works well still.
2) I use dbus to watch for mount/unmounts. This was a recent hack when inotify was pissing me off*, so I just switched to a crappy dbus listener. I'll be altering that code quite a bit to be more lean soon, but for now works perfectly if a little goofy.
* inotify .. you have to remember that for development, we're booting off SD; Most of us are using SD1 as boot partition and firmware partition, with SD2 as like you'd use .. random pnd files and data, etc. So xfce and such would recognize that they're booting from SD1, but also show SD1 as icons on the desktop, along with SD2. ie: In effect you would be seeing in the filesystem your root and /usr and such (from SD1), but also /media/mmcblk0p[12] mounted as well. ie: /media/mmcblk1p1 == /, mounted in two places (!!). inotify really got confused here, as I have notifications across /media/*/pandora/desktop (for example) since thats what will be going live ... but that picks up what is essentially / (and as the pnd system recursively watches subdirs, so you can stick stuff into /pandora/desktop/foo/bar/baz/bing.pnd) you'd be inotify watching the entire firmware. So stick SD2 in, and inotify would catch it usually --- through UDEV mounting into /media, and thus being found on /, or SD1. Think about that.
Anyway, inotify was either buggy or confused, and missing features, when I started on all that mess
*fun*
--
So the short story is yes -- we use inotify to catch file moves, deletes, creates, etc, and dbus to catch mount/unmounts.
And I'm glossing over a lot, since you don't care that much
jeff