From eb9c49a57760a31589b2d5b17e43098f829a457b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 27 May 2020 17:58:28 +0200 Subject: [PATCH] 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. --- source/eventcore/drivers/posix/watchers.d | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/eventcore/drivers/posix/watchers.d b/source/eventcore/drivers/posix/watchers.d index 5bedf24..b85fb8d 100644 --- a/source/eventcore/drivers/posix/watchers.d +++ b/source/eventcore/drivers/posix/watchers.d @@ -382,8 +382,7 @@ final class FSEventsEventDriverWatchers(Events : EventDriverEvents) : EventDrive // complex flags system to the three event types provided by // eventcore if (f & kFSEventStreamEventFlagItemRenamed) { - if (f & kFSEventStreamEventFlagItemCreated) - emit(FileChangeKind.removed); + if (!does_exist) emit(FileChangeKind.removed); else emit(FileChangeKind.added); } else if (f & kFSEventStreamEventFlagItemRemoved && !does_exist) { emit(FileChangeKind.removed);