On created event not correctly handled on linux
Hi,
the following code taken from the on_created event handler:
if self.observer.__class__.__name__ == 'InotifyObserver':
# inotify also generates modified events for created files
return
prevents the on_change method to be called on on_created events.
This appears more as a semantic issue as the on_modified handler seems to do the job for now.
But just partially in fact, because this is the source of the issue #68.
And it would take more importance regarding the issue #58 which implies to distinguish event types.
I think being able to propose an alternative soon.
best regards
Ah yes, the issue with inotify is that it generates multiple events for something we want to handle as one event. It would be good to map out exactly which events are triggered for what situations (file creation, file moved to directory, file modified, file deleted, etc). I'm fairly certain the behavior is different across platforms as well. I don't think watchdog is completely platform agnostic...
I think it's possible to deal with this issue by keeping track of the last event type. I prefer working on this once the PR #75 will be merged as it adds a new event handler.
addressed by #77
Better choice I think, please see my comment here: https://github.com/joh/when-changed/pull/77#discussion_r269607586