Re: Notifications when iPods are mounted...
Re: Notifications when iPods are mounted...
- Subject: Re: Notifications when iPods are mounted...
- From: Pascal Pochet <email@hidden>
- Date: Sat, 14 Jan 2006 11:58:55 +0100
I would do it this way:
iterate thru kIOBlockStorageDeviceClass
for each get the kIOPropertyProtocolCharacteristicsKey (with
IOIterateNext)
in this record get the kIOPropertyPhysicalInterconnectTypeKey
if == kIOPropertyPhysicalInterconnectTypeUSB
get the kIOPropertyDeviceCharacteristicsKey
the product name will be in kIOPropertyProductNameKey
you get more info (the child device) by
IORegistryEntryGetChildEntry (with the device you got from
IOIterateNext at the beginning of the iteration)
get the entry info of the child device
iterate thru it
when the name of the entry is IOFDiskPartitionScheme
get the child entry of the child entry with
IORegistryEntryGetChildEntry
get the name IORegistryEntryGetName of this grand child entry
get the kIOBSDNameKey property out of it
you know have a device path
with getmntinfo you can iterate to find the user visible mounted
point of this device path
(the f_mntfromname field == the device path, the f_mntonname is
the mount point path visible in the Finder)
Pascal Pochet
email@hidden
----------------------------------
PGP
KeyID: 0x208C5DBF
Fingerprint: 9BFB 245C 5BFE 7F1D 64B7 C473 ABB3 4E83 208C 5DBF
Le 13-janv.-06 à 16:35, Uli Kusterer a écrit :
Am 13.01.2006 um 05:47 schrieb Eamon Ford:
(Oops, forgot to send it to the whole list.)
You can detect if an iPod is mounted by calling -[NSWorkspace
mountedRemovableMedia], and then check for an iPod_Control
directory in each volume.
I've had a similar problem, so I was wondering: Did anyone ever
find out how to get from that info to the actual driver or device
name (i.e. when you plug in a camera, the name that System Profiler
shows for a device in its list)? Checking for that directory may
work for an iPod and yield few false positives, but is there a way
to detect the actual device info the system seems to know? Based on
the BSD pathname maybe?
I tried a couple of things a year or so ago, but never really
managed to make the connection between the info I got from Cocoa
and IOKit. Since I'll soon have to get back to the project I used
that on, I'd be really interested in any clues you may have.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden