Take the 2-minute tour ×

Is there any way to monitor /proc files, such as


in a non-polling fashion, similar to inotify on a normal filesystem?

I want to do this in a PyGTK app, so I tried using PyGObject's gio.FileMonitor, but no dice. A Python solution that plays well with gtk.main() would be ideal.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Probably you can get the information you want by listening to the ACPI events. Preferably not directly (/proc/acpi/event), but via acpid or other high-level interface.

Update: the other, higher level interface is the DBus interface provided by DeviceKit-power / UPower.

Files in /proc are not regular files, rather a simple interface to kernel state, so many facilities for regular files won't work there.

share|improve this answer
It does look as though DeviceKit-power is the current best way to do this. –  ezod Mar 1 '10 at 19:02

Your Answer


