Re: looking for sample code to read UUID from a disk volume.
Re: looking for sample code to read UUID from a disk volume.
- Subject: Re: looking for sample code to read UUID from a disk volume.
- From: Chris Suter <email@hidden>
- Date: Thu, 10 Apr 2008 13:38:45 +1000
On 10/04/2008, at 5:05 AM, Herb Petschauer wrote:
And note that only a GUID partition table scheme will yield partitions
with a UUID. The old style Apple Partition Map will not (so any
legacy or even current PPC machines).
No this is incorrect. Volumes have a UUID of their own and is
different from the one used in the GUID partition map. Disk Utility
displays the volume UUID. In HFS the UUID is not actually a proper
UUID but is generated from 8 bytes in the Finder Info of the volume
header. Have a look at the Darwin source code if you want to know how
it's computed. I'm not sure how they're computed for other file-system
types.
The UUID displayed in the IO registry is the GUID partition map UUID.
The UUID that you want to use depends upon the application. If you
want something that always refers to the same volume, you should use
the volume UUID. Unfortunately, there were bugs in older versions of
OS X that meant it's possible for two volumes to end up with the same
UUID so be prepared for this. You might also get duplicates for
volumes that have been cloned. If you want something that refers to
the same physical partition, you should use the partition UUID but
that obviously only works for GUID partition maps so you're actually
better off using something else if that's what you want to do.
I hope this isn't for a competitor to one of our products. :-)
- Chris
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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