PDA

View Full Version : Sample program in Qt which deals in accessing the hard disks?



Gokulnathvc
4th August 2011, 07:22
Sample program in Qt which deals in accessing the hard disks?

FelixB
4th August 2011, 07:29
what do you want? open files? save files? open your computer and remove a harddisk physically?

Gokulnathvc
4th August 2011, 07:34
Just to get return values from the hard disk like model number, firmware version and all...

SixDegrees
4th August 2011, 11:35
Qt doesn't provide a class for such information. On Linux, at least, you need root privileges to obtain such listings; there are C system calls that can provide it, but I'd probably just parse the output of hdparm for the device I was interested in. I have no idea how such things work under Windows.

squidge
4th August 2011, 12:47
DeviceIoControl or WMI services will probably work on Windows, but its beyond the scope of this forum to explain how to use them. Also, on later versions of Windows, these calls may require higher priviledges than which a normal application will have, so you will need to request additional priviledges (perhaps even handling things like UAC on Windows Vista and above)

wysota
5th August 2011, 07:04
It's possible one can obtain such information via dbus on Linux (maybe in org.freedesktop.UDisks on the system bus).

Edit: yes, it works :)

BTW. The same info should be available via /sys interface.

Gokulnathvc
8th August 2011, 14:00
A complete Qt program which accesses the hardware and returns some values. It should contain the whole project with the dll's. or if it is being statically linked. How it has bee linked should also be given??

wysota
8th August 2011, 15:07
A complete Qt program which accesses the hardware and returns some values. It should contain the whole project with the dll's. or if it is being statically linked. How it has bee linked should also be given??

How much are you offering for the program?