how to i get how nay drive are connected with mac machine.
get this list with drive details like name,serial num or volume etc. and so on.
thank.
any help and suggestion on this will be appreciated.
diskutil list -plist
for other options like info that could be useful.man diskutil
I don't know why some folks resist the notion that you can also programmatically simply use NSTask or NSPipe to call a helper function that will do the job for you...
Because then you are dependent on the absolute formatting of the text output. The moment something changes (which it does on a regular basis), then you are screwed. This sort of thing is fine for scripts that you make for yourself, and can maintain yourself, but it is not fine for things that you share with others (free or not).
And there are solid APIs on MacOS X for this. When programming you should use them.
If -plist is specified, then a property list will be emitted instead of the normal user-readable output. If a device is specified, then instead of listing all families of whole disks and their partitions, only one such family is listed. In that case, specifying either the whole disk or any of its slices will work. The -plist and device arguments may not both be specified at the same time.