Results 1 to 14 of 14

Thread: QFileSystemWatcher

  1. #1
    Join Date
    May 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QFileSystemWatcher

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFileSystemWatcher

    Why not use HAL/udev for that?

  3. #3
    freeskydiver Guest

    Default Re: QFileSystemWatcher

    Quote Originally Posted by wysota View Post
    Why not use HAL/udev for that?
    Exists Qt classes who using HAL? If so then where? I need this, too.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFileSystemWatcher

    QtDbus module is available as part of Qt.

  5. #5
    freeskydiver Guest

    Default Re: QFileSystemWatcher

    Quote Originally Posted by wysota View Post
    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?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFileSystemWatcher

    /proc/ is not platform independent as well QtDBus should be available on every unix platform where HAL is working. HAL is a DBus service.

  7. #7
    freeskydiver Guest

    Default Re: QFileSystemWatcher

    Quote Originally Posted by wysota View Post
    /proc/ is not platform independent as well
    That's sure right
    I need this on a AIX and on a Windows machine. Work this?

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFileSystemWatcher

    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.

  9. #9
    freeskydiver Guest

    Default Re: QFileSystemWatcher

    I thought it.
    Which guy from the many good developers here, create a cross-platform class which handled the HAL?

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFileSystemWatcher

    I think we're misunderstanding each other when it comes to HAL. I'm talking about this:
    http://freedesktop.org/wiki/Software/hal

  11. #11
    freeskydiver Guest

    Default Re: QFileSystemWatcher

    Quote Originally Posted by wysota View Post
    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".

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFileSystemWatcher

    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.

  13. #13
    Join Date
    May 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QFileSystemWatcher

    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

  14. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFileSystemWatcher

    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.

Similar Threads

  1. Replies: 3
    Last Post: 21st August 2009, 11:39
  2. Need help with QFileSystemWatcher
    By L.Marvell in forum Qt Programming
    Replies: 1
    Last Post: 18th August 2006, 13:19
  3. QFileSystemWatcher Question (Qt 4.1.2tp)
    By momesana in forum Qt Programming
    Replies: 8
    Last Post: 25th July 2006, 14:01

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.