Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enumerating disks and partitions?



Hi Mike,

You should go through Disk Arbitration to discover and control disks. I/O Kit is good for discovery, but Disk Arbitration is what arbitrates between clients and manages mount behavior. It's the central authority.

The media object could be obtained from Disk Arbitration's messages, of course, with which you can walk down the parent stack looking for a class of IOBlockStorageDevice, which has the additional properties you want.

You can find a sample client called disktool in the project DiskArbitration in CVS. Run "disktool -y", for example, to see the different messages fly by.

Dan

On Sunday, February 9, 2003, at 04:54 PM, Michael D. Crawford wrote:

The document "Accessing Hardware from Applications", which I found under Darwin's developer help has most of what I want, in the section where it shows how to find a CDROM drive's /dev pathname.

http://developer.apple.com/techpubs/macosx/Darwin/General/ AccessingHardware/AccessingHardware.pdf

I tried it by iterating over IOMedia objects that had an ejectable property of false, and got "disk0" and a bunch of slices like "disk0s0".

There are various properties that I can query from the objects, so I think I can identify which ones are normal filesystem partitions (Macs use partitions for the classic driver and the partition map itself, so I don't want to display those).

I'm not sure yet how I can get the manufacturer and model name of the drive but hopefully it is one of the strings I can retrieve from the object's I'm iterating over.

Mike

--
Michael D. Crawford
GoingWare Inc. - Expert Software Development and Consulting
http://www.goingware.com/
email@hidden

Tilting at Windmills for a Better Tomorrow.
_______________________________________________
darwin-drivers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-drivers
Do not post admin requests to the list. They will be ignored.
_______________________________________________
darwin-drivers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-drivers
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Enumerating disks and partitions? (From: "Michael D. Crawford" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.