Skip to content

macOS: renaming a file to same name but different case emits wrong events #146

@bpasero

Description

@bpasero

Have a watcher such as this one:

const nsfw = require("nsfw");

nsfw('<path to folder>', events => {
    for (const event of events) {
        console.log(event);
    }
}, {
    errorCallback: error => console.error(error)
}).then(watcher => {
    return watcher.start();
}).then(() => {
    console.log("DONE")
});

On macOS (I am on 11.6) select a file in the finder and rename the file by only changing the case of one letter of the file.

=> 🐛 the output is:

{
  action: 2,
  directory: '/Users/bpasero/Desktop/nsfw/fixtures',
  file: 'index.js'
}
{
  action: 2,
  directory: '/Users/bpasero/Desktop/nsfw/fixtures',
  file: 'Index.js'
}

Which indicates this is a change event, but I would have expected either rename or delete+add.

This works fine on Windows btw.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions