Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

EACCES when renaming folder that is being watched from nodejs #3395

Copy link
Copy link
@alexdima

Description

@alexdima
Issue body actions

Microsoft Windows [Version 10.0.17134.112]

I am trying to use chokidar, a popular nodejs file system watcher library.

Whenever I use chokidar to listen for file system changes, I can no longer rename folders that lie within the folder being watched.

  • npm install chokidar
  • mkdir test
  • echo hello > test/test.txt
  • create repro.js:
var fs = require('fs');
var chokidar = require('chokidar');

// Watch current directory and ignore the node_modules folder
chokidar.watch('.', {ignored: /node_modules/}).on('all', (event, path) => {
  console.log(event, path);
});

// After sufficient time, attempt to rename the test folder
// Note: this is also reproducible using `mv` on the command line
setTimeout(function() {
    fs.rename('test', 'test2', function(err) {
        if (err) {
            console.log(err);
        } else {
            console.log('rename ok');
        }
    });
}, 1000);

WSL (Ubuntu 18.04):
image

Ubuntu 18.04:
image

I don't think it is terribly important (other colleagues are able to reproduce with other node versions), but I am using nodejs v8.11.3

tuomastanner, jorgeorpinel and DevSchmidtchen

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.