On Sun, Dec 23, 2012 at 03:43:20PM +0000, Stuart Henderson wrote: > On 2012-12-22, Martijn van Duren <[email protected]> wrote: > > Hello misc, > > > > I recently compiled minidlna to run on my local OBSD based home server. > > It runs great by default, but it relies upon inotify to receive > > information on filesystem changes. > > I really like the program, but it's a nuisance to rescan my multimedia > > directories every time I add a new file, so I made an attempt at > > implementing kqueue. Compared to inotify I run into two different > > problems with kqueue. > > 1) It is based upon open file descriptors, so I can't include every > > directory I have in my multimedia-collection, because I run out of open > > file descriptors. > > 2) It only shows that there has been a change in the directory, so I > > have to do a full compare of the files in the directory compared to the > > entries in the database. > > > > Both aren't really big problems (the second is merely a nuisance and the > > first one can be, albeit somewhat incomplete, worked around by just > > including the most current directories). But I would really like to know > > if there is alternative API in OpenBSD (and preferably even more > > portable then that) that comes closer to Linux' inotify functionality, > > or do I just have to make do with kqueue? > > > > Sincerely, > > > > Martijn van Duren > > > > > > I don't think there's an alternative; it may be worth taking a look at > glib's gio-kqueue backend (used in devel/glib2 port; the patch is > at http://distfiles.bsdfrog.org/glib-gio-kqueue-2.34.2-v2.patch) > as used by gnome-tracker.
It's actually used by _lots_ more things via gvfs. http://developer.gnome.org/gio/2.32/GFileMonitor.html -- Antoine

