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

sane not detect moved directory #62

Open
ggkovacs opened this issue Feb 28, 2016 · 4 comments
Open

sane not detect moved directory #62

ggkovacs opened this issue Feb 28, 2016 · 4 comments

Comments

@ggkovacs
Copy link

Directory structure:

  • example1
  • example2
    • text.txt

var watcher = sane('example1', { glob: ['**/*.txt'] });

Sane not detect move example2 to example1.

@amasad
Copy link
Owner

amasad commented Mar 8, 2016

Which watcher are you using? And what operating system is this?
If you can adda test case for this here and send a pull request I'll be able to address it quickly https://github.com/amasad/sane/blob/master/test/test.js

@nkovacs
Copy link

nkovacs commented Jul 12, 2016

I wrote a shell script to test a couple interesting cases: https://github.com/nkovacs/sanetest
It watches test/ with glob **/*.txt.
What doesn't work:

  • with test2/test3/test.txt, moving test2 into test (the result is test/test2/test3/test.txt, which matches the glob)
    • after this move, writes to test/test2/test3/test.txt are not detected
  • with test2/test.txt, moving test2 to test
    • after this move, writes to test/test2/test.txt are detected
  • creating test/test2/test3 and then test/test2/test3/test.txt
    • this doesn't work even if there's a delay between creating the directory and the file

This is on linux with node 4, using sane 1.4.0

@nkovacs
Copy link

nkovacs commented Jul 12, 2016

Almost the same results on osx with node 4 (using nodewatcher), except the following doesn't work either:

  • creating test/test2/ and then test/test2/test.txt
    • this works if there's a delay between creating the directory and the file. On Linux it sometimes doesn't work without the delay, looks like a race condition.

@conartist6
Copy link

I too am finding that sane (@4.1.0) is unable to detect directories moving.

I'm on Mac OSX 10.13.6 and can replicate the issue with either watchman or nodewatcher by moving a folder with watched contents to trash. The watched files in the folder never receive remove events.

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

4 participants