DADiskCopyDescription returns bad values

If I unmount and mount disks then DADiskCopyDescription won't show the new mount point.
I have to close the DA session and restart it to get the new mount point to show up.
This will cause a whole lot of extra work.

Answered by joconnor in 381511022

The answer is -- don't cache DADiskRefs.
The DADiskRef appears to apply now to just a particular state of a disk and copying the description off of a DADiskRef will ALWAYS give you the same dictionary back, even if something about the disk refered to has changed.

Something is causing the stream of events about this disk to be abandoned by Disk Arbitration and I can't figure out what it is. DADiskCopyDescription returns only old values.

Accepted Answer

The answer is -- don't cache DADiskRefs.
The DADiskRef appears to apply now to just a particular state of a disk and copying the description off of a DADiskRef will ALWAYS give you the same dictionary back, even if something about the disk refered to has changed.

DADiskCopyDescription returns bad values
 
 
Q