Re: Listening to Eject command
Re: Listening to Eject command
- Subject: Re: Listening to Eject command
- From: Rippit the Ogg Frog <email@hidden>
- Date: Thu, 30 Jul 2009 00:02:08 -0700
Ed Wynne wrote:
you want DA for DiskArbitration.
DiskArbitration is unfortunately rather poorly documented. It will take
some trial and error to figure out how to make it work for you. But
there are some developer blogs that yield some insight...
... unfortunately the bookmarks I had for them are on my other Mac, some
sixty miles from where I am now...
... but Google could be your friend.
I'm afraid I can't just post my source. But what I suggest you do is
create a very simple application that has an NSTextView in it, and when
you get any kind of notifications from DiskArbitration, append a message
to the text view.
Then put some buttons in your window, such that pressing the buttons
result in commands being sent to DiskArbitration to mount, dismount and
eject a volume, whose BSD name you can either enter manually in an
NSTextField, or you could capture the BSD names that DiskArbitration
tells you about and populate a menu with them.
Note that you can dismount a volume without ejecting it. If you do that
then launch Disk Utility, you'll see the volume's BSD name in Disk
Utility's list, but greyed out. The volume is still "known" to the
system, but just doesn't have a mounted filesystem.
If you make such a testbed application as I describe, eventually
DiskArbitration's operation will become quite clear and even appear
sensibly designed. It's not that it's so difficult, it's that it's just
undocumented.
Ever Faithful,
Rippit the Ogg Frog
email@hidden
http://www.oggfrog.com/
_______________________________________________
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