Re: monitoring file changes in a sysfs filesystem



I'm trying to monitor the changes in a file from /sys (as you know, it's a sysfs filesystem), but setting a file monitor with g_file_monitor_file doesn't work. No matter what I do, I can't receive the changed signal from the file monitor.

sysfs, being a virtual file system, doesn't generate any notification
events.

Yep, I've realized about that. Anyway, I've found that it's possible to monitor changes in these files creating a g_io_channel for the file and setting a watch on it.

you will have to poll yourself, but it's not such a good idea; if you're
looking at hardware events you should probably use udev or HAL.

Yes, you are right :)

Thanks!

--
Miguel Gomez <magomez igalia com>
Igalia - http://www.igalia.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]