Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

OSX: Failure when watching a directory and a subdirectory #21

Closed
robfig opened this issue Oct 9, 2012 · 0 comments
Closed

OSX: Failure when watching a directory and a subdirectory #21

robfig opened this issue Oct 9, 2012 · 0 comments

Comments

@robfig
Copy link
Contributor

robfig commented Oct 9, 2012

Let's say we have two directories, A and B. Directory B is within directory A.

  1. Watching directory A places a DELETE watch on directory B
  2. Subsequently watching directory B (all events) does not invoke watchDirectoryFiles.
  3. 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:

  1. Watch directory B
  2. 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..

howeyc added a commit that referenced this issue Oct 9, 2012
Fixes issue where adding a watch for a directory assumed that all
subdirectories can be watched for only delete. They should, but if they
are already watched we need to preserve the flags already set and add
delete watch.

Issue #21
@howeyc howeyc closed this as completed Oct 10, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants