PDA

View Full Version : QFileSystemWatcher



minty
22nd May 2007, 09:14
I guess QFileSystemWatcher only works on "normal" files. I wanted to use it to monitor files in /proc/net/ so I can determine when certain network interfaces become active/deactive

I could use QFileSystemWatcher on something in /var/log to tell me about network changes, but you have to have root privileges to do so.

I've done a lot of googling to see how to get this kind of notification in my program but nothing yet. Anybody here have an idea.

Thanks in advance

wysota
22nd May 2007, 10:12
Why not use HAL/udev for that?

freeskydiver
22nd May 2007, 11:08
Why not use HAL/udev for that?
Exists Qt classes who using HAL? If so then where? I need this, too. ;)

wysota
22nd May 2007, 11:14
QtDbus module is available as part of Qt.

freeskydiver
22nd May 2007, 11:28
QtDbus module is available as part of Qt.
Unfortunately is the QtDBus only available on Linux. It's not platform independet.
And how I can call the HAL from this?

wysota
22nd May 2007, 11:52
/proc/ is not platform independent as well :) QtDBus should be available on every unix platform where HAL is working. HAL is a DBus service.

freeskydiver
22nd May 2007, 12:17
/proc/ is not platform independent as well :)
That's sure right :cool:
I need this on a AIX and on a Windows machine. Work this?

wysota
22nd May 2007, 13:24
Windows machines don't have /proc/ nor HAL. You'll have to use the native API there. HAL probably won't work on AIX as well.

freeskydiver
22nd May 2007, 13:46
I thought it.
Which guy from the many good developers here, create a cross-platform class which handled the HAL?
:o

wysota
22nd May 2007, 14:06
I think we're misunderstanding each other when it comes to HAL. I'm talking about this:
http://freedesktop.org/wiki/Software/hal

freeskydiver
22nd May 2007, 15:04
I think we're misunderstanding each other when it comes to HAL. I'm talking about this:
http://freedesktop.org/wiki/Software/hal

Oh no... we talk from the same. Windows have an hardware abstraction layer. It's encapsulated in the file "hal.dll".

wysota
22nd May 2007, 15:14
But it's something completely different. Hardware Abstraction Layer is just a concept that can have many implementations. HAL by freedesktop is one of them and Windows HAL is another. But they have nothing in common.

minty
22nd May 2007, 16:12
Wysoto

Thanks for the info on HAL. I thought about that but when I run dbus-viewer, I do not see any interfaces to HAL, I am using OpenSuse 10.2, whose dbus may not support HAL.

I do see that the HAL daemons running, and when I run "hal-device" from a command line it does list all of my network interfaces (and more).

Do you think I should upgrade my dbus package

wysota
22nd May 2007, 16:39
I don't think an update will help. But it's possible that there's something mixed up in your system. I never used HAL so I can't help you with that.