OSX: Failure when watching a directory and a subdirectory
Closed this issue · 0 comments
robfig commented
Let's say we have two directories, A and B. Directory B is within directory A.
- Watching directory A places a DELETE watch on directory B
- Subsequently watching directory B (all events) does not invoke watchDirectoryFiles.
- Therefore, changes within directory B are not reported.
The suggested fix is to call watchDirectoryFiles even if found = true. (Pull request forthcoming)
Additionally, a different but related bug:
- Watch directory B
- Watch directory A, which downgrades the filter on directory B to DELETE, from all events.
The suggested fix here is to check if the directory is already watched. If so, either avoid calling addWatch for it if its flag includes DELETE, or always call addWatch with DELETE|current_flags. If it is not already watched, do the current thing.
The second fix is a little more involved, and I wasn't sure how to do it immediately..