Open KlaAr36 opened 6 years ago
I have reason to wait for either inotify events or stdin events and this code works:
observer = inotify.adapters.Inotify() observer.add_watch(b'tmp') fd = observer._Inotify__inotify_fd [r, w, x] = select.select([sys.stdin, fd], [], [], 10)
But I would prefer this solution:
observer = inotify.adapters.Inotify() observer.add_watch(b'tmp') [r, w, x] = select.select([sys.stdin, observer], [], [], 10)
I suspect it is a matter of implementing fileno() in Inotify:
def fileno(self): return self.__inotify_fd
I have reason to wait for either inotify events or stdin events and this code works:
But I would prefer this solution:
I suspect it is a matter of implementing fileno() in Inotify: