Skip to content

Report remove events #59

@cespare

Description

@cespare

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions