howeyc/fsnotify

Editing file sends 2 events

rzajac opened this issue · 5 comments

When I watch a file and do edit it and save it i get 2 MODIFY events. I should receive only one MODIFY event.

I'm using fsnotify on Linux.

Perhaps it's your editor? If so, for my curiosity, which one?

Does 'echo "stuff" >> file' create two events?
On Apr 26, 2013 5:54 AM, "Rafal Zajac" notifications@github.com wrote:

When I watch a file and do edit it and save it i get 2 MODIFY events. I
should receive only one MODIFY event.

I'm using fsnotify on Linux.


Reply to this email directly or view it on GitHubhttps://github.com//issues/41
.

I was using Sublime Text 2. Will test with vim and >> on monday.

Hey you were right. ST is somehow making MODIFY to fire 2 times. But some other thing I have noticed is that if I open a file in vim do edits then save (MODIFY is fired). Then do some more edits and save the MODIFY is not fired again.

Same problem here. Running on OSX with Sublime Text and sometimes get 2 to 3 MODIFY events on save. A debounce option for events would be nice.

Same on Windows with ST2, but debounce is a must if you do anything other than kill a process on MODIFY --- I remember this from years ago, many other editors also result in 2x modify events being sent.