Ticket URL: <
http://trac.wxwidgets.org/ticket/14834>
#14834: wxFileSystemWatcher: Add wxFSW_EVENT_UNMOUNT flag for inotify's IN_UNMOUNT
-----------------------------------------------------+----------------------
Reporter: dghart | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 2.9.5
Component: base | Version: 2.9-svn
Keywords: wxFileSystemWatcher wxFSW_EVENT_UNMOUNT | Blockedby:
Patch: 1 | Blocking:
-----------------------------------------------------+----------------------
Inotify emits an IN_UNMOUNT event when a watched item's filesystem is
unmounted. wxFileSystemWatcher currently treats this event as an error;
I'm not sure why. The attached patch (which should be applied after the
IN_ATTRIB one but doesn't depend it) converts it to wxFSW_EVENT_UNMOUNT
which I've added to the wxFSWFlags enum (using the IN_UNMOUNT value for no
important reason). It shouldn't be included in wxFSW_EVENT_ALL as
IN_UNMOUNT is not intended to be a user-requested watch and is outside the
INOTIFY_ADD_WATCH bit-mask.
As unmounting is not entirely cross-platform, I've #if def.ed
wxFSW_EVENT_UNMOUNT in common code. In the future, NOTE_REVOKE looks like
the best kqueue match; this is currently ignored.
I can't think of a good way to add a test for this, but it can be seen to
work in the fswatcher sample: mount something, watch a dir inside that
filesystem, then unmount it.
--
Ticket URL: <
http://trac.wxwidgets.org/ticket/14834>