Re: DiskArbitration API
Re: DiskArbitration API
- Subject: Re: DiskArbitration API
- From: Dan Markarian <email@hidden>
- Date: Mon, 2 May 2005 17:11:38 -0400
Hi Jesper,
Disk Arbitration SPIs do continue to work on Tiger. What do you do
with the port you are handed back in DiskArbStart()? Do you add it
do your run loop? You must add it to your run loop in order to
service it and have your notifications fire. You can also use
DiskArbMsgLoop() to service it as an alternative.
You may ask how some applications do work on Panther even with the
oversight. The port from the SPI is a global port, for historical
reasons. You may get lucky in case someone else in your application
does do the right thing by adding it to the main run loop. It was
probably File Manager.
File Manager has since moved onto the new APIs. You must service the
port you are handed back to be sure to receive notifications. The
same is true of the new APIs, which are also present on Panther, and
most other notification APIs, as a general rule.
You can take a look at the disktool.c sample code, in the
DiskArbitration project, to see how to service that port with a run
loop on the old SPI. You are welcome to use the new API as well.
You may sign up with DARegisterDiskPeekCallback() and claim your disk
in that callback with DADiskClaim().
Dan
On 2 May 2005, at 5:52 AM, Jesper Papmehl wrote:
Hello!
We have an app that reads (removable) disks that uses a file system
that Mac OS X doesn't recognize. We have been using the
DiskArbitration API to make the OS ignore the disks as they are
inserted, to prevent the "disk cannot be read" dialog from
appearing. This has been working fine, until Tiger, where it
stopped working because the DiskArbitration API has been completely
redesigned. (Not that I'm complaining, I know that we have been
using a private, unsupported API.)
I have not been able to find any documentation for the new API
(apart from the brief comments in the headers), and I'm having a
bit of trouble getting started. What I want to do is to get
notified whenever a disk is about to be mounted, and then tell the
OS to ignore the disk. Does anyone know how to do this using the
Tiger version of DiskArbitration?
Thanks for any help!
/Jesper Papmehl
Propellerheads
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden