Fix the FSEvent rename logic.

It turned out to be impossible to determine the source and target names for a rename operation, so the actual existence of the file has to be used.
This commit is contained in:
Sönke Ludwig 2020-05-27 17:58:28 +02:00
parent 8695b4d32c
commit eb9c49a577

View file

@ -382,8 +382,7 @@ final class FSEventsEventDriverWatchers(Events : EventDriverEvents) : EventDrive
// complex flags system to the three event types provided by // complex flags system to the three event types provided by
// eventcore // eventcore
if (f & kFSEventStreamEventFlagItemRenamed) { if (f & kFSEventStreamEventFlagItemRenamed) {
if (f & kFSEventStreamEventFlagItemCreated) if (!does_exist) emit(FileChangeKind.removed);
emit(FileChangeKind.removed);
else emit(FileChangeKind.added); else emit(FileChangeKind.added);
} else if (f & kFSEventStreamEventFlagItemRemoved && !does_exist) { } else if (f & kFSEventStreamEventFlagItemRemoved && !does_exist) {
emit(FileChangeKind.removed); emit(FileChangeKind.removed);