Results 1 to 11 of 11

Thread: how to notify an application when a usb flash drive gets connected..

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    76
    Thanked 37 Times in 32 Posts

    Default Re: how to notify an application when a usb flash drive gets connected..

    As an alternative you could try to monitor the file system (either /etc/fstab or /mnt/something) if you are sure that the device will be automounted in a particular location but this method might fail, so using HAL is a preffered solution.
    How about /proc ?
    We can't solve problems by using the same kind of thinking we used when we created them

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

    Default Re: how to notify an application when a usb flash drive gets connected..

    Quote Originally Posted by sunil.thaha View Post
    How about /proc ?
    What about it?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: how to notify an application when a usb flash drive gets connected..

    Quote Originally Posted by sunil.thaha View Post
    How about /proc ?
    Yes, but not every system allows normal users to dig inside it. A similar solution is to use libusb and look from time to time for new devices.

  4. #4
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 74 Times in 54 Posts

    Default Re: how to notify an application when a usb flash drive gets connected..

    Quote Originally Posted by sunil.thaha View Post
    How about /proc ?
    The problem with /proc is that Linux treats it entirely different than do other Unix and Unix-like systems. Basing an application on Linux's procfs behavior means that it won't work under BSD, Solaris, etc. I would look for a better crossplatform approach.

  5. The following user says thank you to Brandybuck for this useful post:

    sunil.thaha (4th December 2006)

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

    Default Re: how to notify an application when a usb flash drive gets connected..

    Furthermore /proc under Linux starts to be deprecated in favour of /sys so there is a probability that /proc (or at least most of its functionality) will soon vanish from some Linux distros.

  7. The following user says thank you to wysota for this useful post:

    sunil.thaha (4th December 2006)

  8. #6
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    76
    Thanked 37 Times in 32 Posts

    Default Re: how to notify an application when a usb flash drive gets connected..

    Waw!!

    Didn't know all of those... Cross platform, Deprecated !!!
    Thanks for sharing the info, Guys
    We can't solve problems by using the same kind of thinking we used when we created them

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
  •  
Qt is a trademark of The Qt Company.