Re: Finding out that a volume is going away before it does
Re: Finding out that a volume is going away before it does
- Subject: Re: Finding out that a volume is going away before it does
- From: email@hidden
- Date: Mon, 27 Oct 2008 09:37:04 +0100
On 26 Oct 2008, at 17:37, Gregory Weston wrote:
Specifically, I'm looking for the opportunity to call
FSGetCatalogInfo on the mount point and then FSGetVolumeInfo on the
volume reference number I got back from the first call.
Greg
It look to me like registering for kEventClassVolume /
kEventVolumeUnmounted carbon events would do what you need. This will
tell you the cRefNum of the unmounted volume (once again though after
it had gone).
Matt Gough
* kEventClassVolume / kEventVolumeUnmounted
*
* Summary:
* An existing volume has been unmounted (or media ejected).
*
* Discussion:
* This event is sent to all handlers registered for it.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* --> kEventParamDirectObject (in, typeFSVolumeRefNum)
* The volume refnum of the volume that was unmounted. At the
* point when this event is sent, this is no longer a valid
* volume refnum, and cannot be passed to any File Manager
* API; it is useful only for comparison with cached volume
* refnums in your own data structures.
*
* Availability:
* Mac OS X: in version 10.0 and later in Carbon.framework
* CarbonLib: in CarbonLib 1.3.1 and later
*/
enum {
kEventVolumeUnmounted = 2
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden