Rename events are occasionally split into two events on linux
It seems like this can happen if the same file is renamed twice very quickly. The second rename is fine but the first one can be split into two separate rename events, on for the old path and one for the new path. For both of these split events the associated path is null, with no indication which one was created and which was destroyed.
Finally got around to looking at this.
Seems easily reproducible. Have a little script which does the trick. Can be in tool/test in the future for a regression test.
Affects both inotify and fanotify.
No warnings or errors are reported during the test runs I have going (which is good).
Rolling over in my head how safe it is to just drop "invalid" rename events, since the second time these are reported seems consistently fine.
Fixed in https://github.com/e-dant/watcher/commit/b8b0d8d9638b740a6546c107fba53fdb2decf9ac, released in 0.13.6