help icon indicating copy to clipboard operation
help copied to clipboard

Why don't libuv emit actual rename/move file event

Open Leaking opened this issue 5 years ago • 2 comments

as i know, the kqueue / inotify / and so on all supports monitor file rename/move event。

and we can find these code in libuv, it seems libuv turn all events into UV_RENAME/UV_CHANGE

        switch (file_info->Action) {
            case FILE_ACTION_ADDED:
            case FILE_ACTION_REMOVED:
            case FILE_ACTION_RENAMED_OLD_NAME:
            case FILE_ACTION_RENAMED_NEW_NAME:
              handle->cb(handle, filename, UV_RENAME, 0);
              break;
            case FILE_ACTION_MODIFIED:
              handle->cb(handle, filename, UV_CHANGE, 0);
              break;
          }

Leaking avatar Dec 02 '19 14:12 Leaking

What is your specific suggestion here?

saghul avatar Dec 03 '19 06:12 saghul

What is your specific suggestion here?

keep the move / rename event with two filepaths, instead of turning them into UV_RENAME with one filepath

Leaking avatar Dec 03 '19 08:12 Leaking