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

selective exclusion #273

Open
mobileink opened this issue May 14, 2021 · 1 comment
Open

selective exclusion #273

mobileink opened this issue May 14, 2021 · 1 comment

Comments

@mobileink
Copy link

Thanks for this great sw! I'm using libfswatch to create to tool and it's working great.

I'm looking for a good way to selectively exclude stuff. Currently I start by excluding everything (".*") and then adding includes for the directories I want to watch. The problem is that editors (well, at least emacs) like to create transient files that I do not need to watch. In particular, emacs creates and deletes lockfiles as you edit. For example, if you change foo.c, then emacs will create .#foo.c, which it will delete when you save your changes.

This results in three fs change events, for for .#foo.c create, one for foo.c update, one for .#foo.c removal.

Is there a simple way to exclude such files/events? I suppose I could write some kind of regex to handle it but that would presumably incur a performance hit. Maybe that's unavoidable. Obviously the workaround is to implement my own filtering logic on the events I receive, but it would be nice if libfswatch could handle this case.

Similar problem: suppose I want to watch a directory foodir (recursively), and somewhere below it there is a directory I want to ignore - e.g. a .git directory or some such. Any way I can tell libfswatch to handle this?

I guess I'm looking for filter conjunction, i.e. "include if regex1 AND NOT regex2".

Thanks,

Gregg

@thoni56
Copy link

thoni56 commented May 17, 2021

I totally agree!

I've been frustrated with this too, and it would really help to have an "exclusively match" option that only matches the patterns given.

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

2 participants