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

Exclude items with poll_monitor not considered #66

Closed
walterdolce opened this issue Oct 29, 2014 · 15 comments
Closed

Exclude items with poll_monitor not considered #66

walterdolce opened this issue Oct 29, 2014 · 15 comments

Comments

@walterdolce
Copy link

Hi @emcrisostomo. As per #62, I was trying a different monitor but it seems that by using the ones below the -e parameter items are not taken into account.

When I launch:

> fswatch  -l 0.1 -r -e \.git/ -x ./ -m kqueue_monitor 

or:

> fswatch  -l 0.1 -r -e \.git/ -x ./ -m poll_monitor 

And I modify a file in the same directory, I get notified about what's in the .git/ folder as well.
I also tried by not escaping the dot (.) in the .git/ parameter item just to double check and I get the same result (of course I'd say as it requires a regexp).

Is the excluded items feature something specifically related to FSEvents not supported by the ones above?
Do kqueue_monitor or poll_monitor require different param settings to exclude items?

Version in use is fswatch 1.4.5

Thank you!

@walterdolce walterdolce changed the title Exclude items with kqueue_monitor or poll_monitor Exclude items with kqueue_monitor or poll_monitor not considered Oct 29, 2014
@emcrisostomo
Copy link
Owner

Hi @walterdolce,

This looks like a bug: every monitor should honour the exclusion/inclusion patterns. I'll have a look at it ASAP.

@emcrisostomo
Copy link
Owner

Hi @walterdolce,

There's a bug in the poll_monitor, tomorrow I'll test it and will release a fix.

The kqueue_monitor, on the other hand, is working correctly. The kqueue API is sending an update notification for the /path/to/.git: since the exclusion filter is .git/, the final / does not match the path and the record is correctly notified.

Cheers,

Enrico.

@walterdolce
Copy link
Author

Ah! Thanks for this @emcrisostomo .

So to exclude a directory and its content one should not put the ending forward slash?

In the mean time though, I look forward for the fix as I will probably use the poll_monitor for portability reasons (on this, would you also recommend it?).

Thanks!

@walterdolce
Copy link
Author

Hi @emcrisostomo . Is there a way I could contribute on this?

Note that I'm not a C/C++ developer but I could start at any time given some guidance :-P

Thanks!

@emcrisostomo emcrisostomo changed the title Exclude items with kqueue_monitor or poll_monitor not considered Exclude items with poll_monitor not considered Nov 6, 2014
@emcrisostomo
Copy link
Owner

Hi @walterdolce,

Sorry for the belated answer and thanks for the offer. In this case, it was not complexity, but available time the reason to delay this.

I've just pushed 1.4.5.2 to the repository, and I'm preparing MacPorts and Homebrew package updates. I'm going to close this issue.

Now, to answer your questions: yes, regular expressions are used and directories do not contain a final path separator character. Hence, to filter them out, you should not add it, otherwise the event path will not be matched.

Cheers.

@walterdolce
Copy link
Author

Hi @emcrisostomo . Thank you so much for this.

Guess Homebrew package is not yet updated as I have brew upgrade fswatch and the exclusion when using poll_monitor still doesn't work.

Will wait for that and let you know.

Cheers!

@emcrisostomo
Copy link
Owner

Hi @walterdolce,

Yes, you've got to wait for their build machines to prepare the package. Here is the status of the 1.4.5.2 package and as you can see the package build is OK and it's in queue for merging.

Cheers.

@walterdolce
Copy link
Author

Hi @emcrisostomo

Thank you for the link above. I'm afraid though that exclusions are still not working.

Following are the commands I launched. All of them were failing:

> fswatch  -l 0.1 -r -e .git -x ./ -m poll_monitor
> fswatch  -l 0.1 -r -e \.git -x ./ -m poll_monitor

> fswatch  -l 0.1 -r -e ./.git -x ./ -m poll_monitor
> fswatch  -l 0.1 -r -e ./.git/ -x ./ -m poll_monitor

> fswatch  -l 0.1 -r -e \./\.git -x ./ -m poll_monitor
> fswatch  -l 0.1 -r -e \./\.git/ -x ./ -m poll_monitor

> fswatch  -l 0.1 -r -e .git/ -x ./ -m poll_monitor
> fswatch  -l 0.1 -r -e \.git/ -x ./ -m poll_monitor

Note that I've also sent the path with final forward slashes, just to double check.
I have upgraded fswatch via brew upgrade fswatch right after I saw the build was finished and green. So I'm assuming that I'm using the latest version.

On versioning specifically, note that fswatch --version doesn't show up the full version scheme used for fswatch (that is, 1.4.5.3). But only the MINOR.MAJOR.PATCH as defined in semver.org. So I'm not sure which specific version I have. I'd assume the latest though.

Thanks!

@emcrisostomo
Copy link
Owner

Hi @walterdolce, I made a test and it works here:

% ./src/fswatch -r -e .git -x ~/temp -m poll_monitor

and I see no output when I touch files into ~/temp/.git.

if you don't see 1.4.5.3, then I guess you don't have it. The version is included into the sources so I see no way it could be otherwise. You should see:

% ./src/fswatch --version
fswatch 1.4.5.3
Copyright (C) 2014, Enrico M. Crisostomo <enrico.m.crisostomo@gmail.com>.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Enrico M. Crisostomo.

Could you download the release source tarball and build it yourself?

If there's some problem with Homebrew and the 4-digit versioning scheme I use, I guess I'll think about changing it.

@walterdolce
Copy link
Author

Hi @emcrisostomo .

Yes. I can definitely confirm that after manually installing it from the above it's working as expected.
And I can also confirm that fswatch --version returns what you posted in the output above.

Thank you so much!

Have a nice weekend.

Best,
Walter

@emcrisostomo
Copy link
Owner

Hi @walterdolce,

Cool, thanks for confirming this. Have a nice weekend too.

Cheers,

Enrico

@ihorman
Copy link

ihorman commented Dec 3, 2016

Hi Enrico,

First of all I want to say thanks for the application, it's really nice. Looks like the regex in --exclude directive this doesn't work

I am running an application, version 1.9.3, in this way:

fswatch --monitor=poll_monitor --exclude='.zfs' -r /mymountedfolder/

when I do strace -p <PID of fswatch> I still can see it makes

lsstat ('/mymountedfolder/.zfs/lotsofdata-that-need-to-be-excluded')

the problem in my case I have 21 million of files and I need to exclude that paths to make this polling not running forever, but looks like this doesn't work for me for some reason.

@emcrisostomo
Copy link
Owner

Hi @ihorman,

This definitely looks like a different issue. Furthermore, this one is marked as close. Would you please open a new one? I'll have a look at it in the next few days.

@emcrisostomo
Copy link
Owner

Opened #151

@ihorman
Copy link

ihorman commented Dec 6, 2016 via email

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

3 participants