There a "wx Way" to access USB drives?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
User avatar
Parduz
Experienced Solver
Experienced Solver
Posts: 53
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

There a "wx Way" to access USB drives?

Post by Parduz » Fri Feb 08, 2019 8:55 am

I'm writing a simple, custom dialog for my "kiosk" app to open files from predefined location.
So it will not show the path, or even let you pick another one. It is just a list of files.
BUT
I'd like to have a button which will be enabled only if there's a pen drive in the USB slot.
Problem is: how do i know if a pendrive is plugged in the USB slot? And how i will access it?
There's some "wxWidgets" object that i could use, as my app must work on Debian and on Windows?

User avatar
doublemax
Moderator
Moderator
Posts: 13874
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: There a "wx Way" to access USB drives?

Post by doublemax » Fri Feb 08, 2019 1:07 pm

There is no "wx way" to handle this. Under Windows wxFSVolume would do the trick, but it's only available there.

Maybe under Linux using wxFileSystemWatcher to monitor "/proc/mounts" might work, but it's a very wild guess. I don't even know it it works at all for virtual filesystems.
Use the source, Luke!

Post Reply