wxFileSystemWatcher: better processing of inotify IN_MOVE events
|Reported by:||dghart||Owned by:|
IN_MOVE inotify events are produced both by what a user sees as moves and by renames.
- A rename gives an IN_MOVE_FROM event immediately followed by an IN_MOVE_TO. Both have the same path.
- A move from a watched dir will result in only an IN_MOVE_FROM. A move into one gives only an IN_MOVE_TO.
- A move within a tree of watches gets both IN_MOVE_FROM and IN_MOVE_TO. These aren't currently processed optimally.
The problem is the paths. In this situation the filename is the same for both events but the path differs. If the events arrive far enough apart that they aren't recognised as a pair, they will be dealt with separately in ProcessRenames() and the paths of both resulting wxFileSystemWatcherEvents will be correct. However for me they arrive in the same batch of events, and so are treated as a pair. That means the path is extracted from only the IN_MOVE_TO event's watch, so the owner doesn't receive a valid 'from' path.
The patch fixes this by passing paths taken from both of the original watches. This won't affect a true rename as both paths will be identical, or unpaired IN_MOVEs as ProcessRenames() is unchanged. I've also added internal documentation for IN_MOVE processing.
Change History (4)
comment:1 follow-up: ↓ 2 Changed 16 months ago by vadz
- Milestone changed from 2.9.5 to 3.0
- Priority changed from normal to low