tags:

views:

74

answers:

1

Hi everyone!
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.. 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)

+3  A: 

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

jspcal
I'm sorry but Pyinotify has a "polling" API from what I can see.. Am I mistaken?
Joril
You must use the `ThreadedNotifier` which runs in its own thread the process the inotify events.
Aaron Digulla
will use the cool linux inotify which is event-driven
jspcal
ThreadedNotifier + wx.CallAfter = success, many thanks :)
Joril