Re: DiskArb DiskChangedCallback bug?
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Hi Brian, Dan Le 12 Jun 2006 à 1:58 PM, Brian Bergstrand a écrit : -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Jun 12, 2006, at 12:49 PM, Chris Sarcone wrote: Brian -- Nevermind. I was looking at the wrong API. extern CFArrayRef kDADiskDescriptionWatchVolumePath; Thanks for the quick response! -- Chris On Jun 12, 2006, at 10:42 AM, Chris Sarcone wrote: Brian -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (Darwin) _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... DADiskDescriptionChangedCallback does notify you when a property of a disk has changed, including whether it is mounted or not, however, it does not notify you of the existence of the disk. You must also subscribe to DADiskAppearedCallback and DADiskDisappearedCallback. It is possible that a disk is already mounted when we tell you of its existence. As for using DARegisterDiskDescriptionChangedCallback() for mounts, I think that's incorrect. DARegisterDiskDescriptionChangedCallback() is meant to track disk that are already mounted and changing either their name or path. I think your really want DARegisterDiskAppearedCallback(). Hmm, won't that be called when the disk appears in IOKit and not when it's mounted? I don't really care about the former. Or will it be called both for attach and mount? If that's the case, then I could use the volumePath key in the Disk dictionary to determine if it's being mounted. Also, if ChangedCallback() is not supposed to be used, then the documentation should be clarified: /*! * @constant kDADiskDescriptionWatchVolumePath * Predefined CFArray object containing a set of disk description keys appropriate for * watching volume mount changes using DARegisterDiskDescriptionChangedCallback(). */ I take "watching volume mount changes", to mean changing from mounted - -> unmounted OR vise-versa. "watching volume un-mounts" would be a better term if that is all ChangedCallback does. DARegisterDiskDescriptionChangedCallback(daSession, NULL, kDADiskDescriptionWatchVolumePath, DiskArbCallback_ChangeNotification, NULL); The third argument is supposed to be a CFArrayRef of keys to watch, not a CFDictionaryRef. You might want to try fixing that, then retest... iD8DBQFEjatIedHYW7bHtqIRAjrnAKDueVlFzcor+NdyG0haXVfsaWMVjwCcCqbv hDuY/92TfgL7KQWq9/yEUqo= =yBfx -----END PGP SIGNATURE----- _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/markarian% 40apple.com This email sent to markarian@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Dan Markarian