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

Supporting remove event in watch. #213

Merged
merged 2 commits into from
Oct 4, 2016
Merged

Conversation

tanema
Copy link
Contributor

@tanema tanema commented Oct 4, 2016

fixes #159

I made sure that watch now removes files but also touched up the file watcher code to ensure that it will accurately respond to all events that it gets.

cc @chrisbutcher @jessicaxiejw @ilikeorangutans

select {
case currentEvent = <-events:
if currentEvent.Op == fsnotify.Chmod {
if currentEvent.Op&fsnotify.Chmod == fsnotify.Chmod {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo here, with the placement of &

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is a bitwise AND, because the OP can be several different ops. You need to check it this way to be acurate. Check this out: https://github.com/fsnotify/fsnotify/blob/master/fsnotify.go#L37

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think it's just the spacing is off?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go fmt formats it this way. I have my vim setup so that is formats on save.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that makes total sense. The spacing is just unusual looking

@chrisbutcher
Copy link
Contributor

Thanks for clarification on how go fmt formats bitwise operators, TIL.

LGTM

@tanema tanema merged commit 24284f5 into master Oct 4, 2016
@tanema tanema deleted the file_watcher_create_and_delete branch October 4, 2016 21:05
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

Successfully merging this pull request may close these issues.

Theme watch does not delete files
2 participants