• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Listening to Eject command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Listening to Eject command (From: Farooq zaman <email@hidden>)
 >Re: Listening to Eject command (From: Ed Wynne <email@hidden>)

  • Prev by Date: Re: Cahnging bgColor of a UIView not working.
  • Next by Date: Re: Cahnging bgColor of a UIView not working.
  • Previous by thread: Re: Listening to Eject command
  • Next by thread: UIWebView: prevent from displaying menu, Copy.
  • Index(es):
    • Date
    • Thread