wxFileSystemWatcher: Add wxFSW_EVENT_ATTRIB flag for inotify's IN_ATTRIB
|Reported by:||dghart||Owned by:|
wxFileSystemWatcher currently ignores a couple of useful inotify events (and several less-useful ones). In particular, without IN_ATTRIB there's no way of detecting a file being touched.
The attached patch implements this. There's a new wxFSW_EVENT_ATTRIB in the wxFSWFlags enum. I've not #if def.ed this as it looks as if it could be extended to the other platforms in the future. The MSW equivalent would be FILE_NOTIFY_CHANGE_ATTRIBUTES, which is currently unmapped in wxIOCPThread::Native2WatcherFlags. NOTE_ATTRIB, the nearest kqueue equivalent, is already mapped to wxFSW_EVENT_ACCESS (though from reading the man-page, wxFSW_EVENT_MODIFY might have been more appropriate). BTW, the wxFSWFlags doc states that wxFSW_EVENT_ACCESS is 'currently only detected under Linux' which is presumably wrong, but I'm unable to test that here.
I've added a test for the new flag, and it can also be seen to work in the fswatcher sample.