-
-
Notifications
You must be signed in to change notification settings - Fork 722
Closed
Description
If the filter is set to FileClosedEvent
, the mask is set to InotifyConstants.IN_CLOSE
which includes IN_CLOSE_WRITE
and IN_CLOSE_NOWRITE
, but only IN_CLOSE_WRITE
will call on_closed()
. I think line 236 should be modified to event_mask |= InotifyConstants.IN_CLOSE_WRITE
to improve performance and maintain logical consistency in the code.
watchdog/src/watchdog/observers/inotify.py
Lines 235 to 236 in 9f23b59
elif cls is FileClosedEvent: | |
event_mask |= InotifyConstants.IN_CLOSE |
watchdog/src/watchdog/observers/inotify.py
Lines 190 to 199 in 9f23b59
elif event.is_close_write and not event.is_directory: | |
cls = FileClosedEvent | |
self.queue_event(cls(src_path)) | |
self.queue_event(DirModifiedEvent(os.path.dirname(src_path))) | |
elif event.is_open and not event.is_directory: | |
cls = FileOpenedEvent | |
self.queue_event(cls(src_path)) | |
# elif event.is_close_nowrite and not event.is_directory: | |
# cls = FileClosedEvent | |
# self.queue_event(cls(src_path)) |