tags:

views:

435

answers:

5

How can I, programmaticaly, read the hardware information of my drives?

A: 

You can use the GetDriveType Method from the win32 library, and you might be able to differentiate that way, or you use GetVolumeInformation to try and determine it from the label.

Jeremy Morgan
'coz my app maybe run on any host, i dont know what the label will be...so i think guessing label is suitable
Macroideal
+1  A: 

Have you considered doing a read/write test to try to determine capabilities ?

Simon_Weaver
NO, when my app is installed, i will check all the drives, if there is one SSD, it's running another way...
Macroideal
A: 

This guess is a long shot but I can't find anything better. In the device's identification structure, see if it supports acoustic management. Old disk drives didn't, but maybe most modern disk drives do. Obviously SSDs don't need acoustic management but let's hope they'll say they don't, instead of pretending to be disk drives.

Windows programmer
This isn't going to work. Seagate has dropped acoustic management from their modern conventional drives.
ChrisInEdmonton
+2  A: 

SSD are supposed to identify themselves as non-rotative. For linux, as example, you can get the info via sysfs:

cat /sys/block/sda/queue/rotational

If it returns 0, you have SSD...

pan1nx
A: 

This is basically a duplicate of this question, so you may want to check there for more information. There's some code there to determine the rotational latency of the drive, which I have not tried myself.

ChrisInEdmonton