Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'add' and 'unlink' events not triggering with folders #11

Open
HRK44 opened this issue Nov 26, 2018 · 1 comment
Open

'add' and 'unlink' events not triggering with folders #11

HRK44 opened this issue Nov 26, 2018 · 1 comment

Comments

@HRK44
Copy link

HRK44 commented Nov 26, 2018

Ubuntu 18.04.1

The add event is not triggering on folder creating, same for unlink.

    let rootWatcher = new INotifyWait(dir, {
        recursive: true
    });

    rootWatcher.on('ready', () => console.log('watching now...'));
    rootWatcher.on('add', (filename, stats) => console.log('new file created : ' + filename));
    rootWatcher.on('unknown', filename => console.log('unknown event...'));
    rootWatcher.on('unlink', filename => {
        console.log('deleted file : ' + filename);
        // rootWatcher.close();
    });
@HRK44
Copy link
Author

HRK44 commented Nov 26, 2018

Never mind, there is the option watchDirectory that you have to set to true for this to happen. Not mentioned anywhere on the README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant