• 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: DADiskEject and Resource Busy errors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DADiskEject and Resource Busy errors


  • Subject: Re: DADiskEject and Resource Busy errors
  • From: Chris Suter <email@hidden>
  • Date: Wed, 31 May 2006 14:02:37 +1000

In slightly different circumstances, I've found that you can't access the disk immediately after it says the disk has been unmounted. I hacked things by adding a retry loop but I'd prefer a cleaner solution. The code for disk arbitration and the kernel is obviously open source, so you could always have a look and see what it does. If all you're doing is ejecting a CD, do you really need to unmount it first? Have you tried just calling DADiskEject without unmounting it first?

On 31/05/2006, at 1:48 PM, Stephen F. Booth wrote:

I realize this may not be the best place to ask this question, but I did not see a more suitable list.

I'm using the DiskArbitration framework for unmounting and ejecting removable CD media. I have run into a peculiar issue where sometimes CDs unmount successfully, but fail to eject. My code looks like:

Unmount the disc in preparation for ejection:

DADiskUnmount(disk, kDADiskUnmountOptionWhole, unmountCallback, context);

If the unmount was successful, request the eject in unmountCallback:

if(NULL != dissenter) {
DAReturn status = DADissenterGetStatus(dissenter);
// Error handling omitted
}

DADiskEject(disk, kDADiskEjectOptionDefault, ejectCallback, context);


And finally, the code that produces the error message:

		if(NULL != dissenter) {
			DAReturn status = DADissenterGetStatus(dissenter);
			// Error occurs here
		}

The strange thing is, maybe 50% or more of the time the disc will unmount but fail to eject with an error code 16 (Resource Busy). I assume since the disc successfully unmounted that no resources should be in use. I don't see any other DA* APIs that will do what I want.

Have I missed something in my usage of the framework?

Stephen
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
systems.com


This email sent to email@hidden


--
Coriolis Systems Limited is a limited company incorporated in England and Wales
Company No. 5061807 Registered Office: 72 New Bond Street, London W1S 1RR




_______________________________________________
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


References: 
 >DADiskEject and Resource Busy errors (From: "Stephen F. Booth" <email@hidden>)

  • Prev by Date: Simple Graphs
  • Next by Date: Re: Exposing Methods in a Framework
  • Previous by thread: DADiskEject and Resource Busy errors
  • Next by thread: ANN: StepTalk 0.12
  • Index(es):
    • Date
    • Thread