Re: Lifetime of DADiskRef
Re: Lifetime of DADiskRef
- Subject: Re: Lifetime of DADiskRef
- From: Chris Suter <email@hidden>
- Date: Thu, 11 Nov 2010 22:47:25 +1100
Hi Jim,
On Thu, Nov 11, 2010 at 8:17 PM, Jim O'Connor <email@hidden> wrote:
> What is the lifetime of a DADiskRef?
>
> It appears that I can the DADiskRef can change periodically for a given disk/partition. This isn't what I expected. I expected that the DADiskRef would be constant within a DA session.
>
> For example, I can get disk changed notifications for DADiskRefs which never got a disk appeared notification.
You cannot use the == operator to compare DADiskRefs. As you have
discovered, you will find that more than one DADisk object can refer
to the same diskâthey are created fresh as new notifications arrive.
They are Core Foundation objects so you can use CFEqual to compare.
You can also store them in a set or dictionary and search for them
that way.
By the way, the disk arbitration code is open source so you can see
exactly what Apple's code does.
Kind regards,
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden