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

Report remove events #59

Open
cespare opened this issue Feb 19, 2019 · 0 comments
Open

Report remove events #59

cespare opened this issue Feb 19, 2019 · 0 comments

Comments

@cespare
Copy link
Owner

cespare commented Feb 19, 2019

This was reported by @maysunfaisal on #58.

We should notify on remove events. For example, if you delete a .c file, you probably want to rerun make to see if the build broke.

It's tricky because we also need to know whether an event was for a directory or not. This is exposed to the user in two ways:

  1. The path matched against the user's glob/regex is documented as having a trailing / if and only if the path is a directory.
  2. The --only-dirs and --only-files flags allow the user to only match against one or the other.

Right now we don't know this information when we get a remove event because the file/directory is already gone. To implement this, we'd need to keep our own in-memory representation of the watched tree (or at least a set of known directories); we can reference this when we get a remove event.

I anticipate annoying corner cases where this cache gets out of sync with the filesystem.

This is related to #13 and possibly #39.

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