Non-polling file monitoring in wxPython
I have a wxPython application that needs to know when a certain file gets deleted, but I'd like to do it without having to use a "polling" technique开发者_JS百科.. Since this is a Linux-only app, I thought I could use GIO, but it looks like it needs a call to gtk.main() and I can't do that because that'd stop the execution flow on the wxPython side...
Is there a workaround or an alternative way?(Xubuntu 9.04, wxPython 2.8.9.1)
Pyinotify can do that
or you can run inotifywait in the background and have it send you a signal when the event occurs.
or perhaps roll your own with inotifywait() in C
精彩评论