PyInotify icon indicating copy to clipboard operation
PyInotify copied to clipboard

InotifyTree doesn't work on re-created directory

Open AiRyunn opened this issue 6 years ago • 3 comments

I'm using InotifyTree, but when I recreate a directory, it outputs "Path already being watched: /my/folder", and ignore all events about this folder.

AiRyunn avatar Nov 14 '19 09:11 AiRyunn

I'm having the same problem.

dkrystki avatar Jun 23 '20 15:06 dkrystki

It seems this issue is caused by the module not listening to IN_DELETE_SELF events. In theory it would work to just register yourself for that event and call remove_watch on the Inotify object, however since the superficial parameter is not passed on from remove_watch to remove_watch_with_id this would result in an invalid system call. Since this is the last statement in that function calling remove_watch and catching that exception works as a workaround for me....

PlasmaHH avatar Mar 19 '21 14:03 PlasmaHH

This is already fixed in the master branch but not the current pip package.

pip install git+https://github.com/dsoprea/PyInotify

dheeg avatar Sep 22 '22 06:09 dheeg