Re: Decoding xattrs in an AppleDouble file
Re: Decoding xattrs in an AppleDouble file
- Subject: Re: Decoding xattrs in an AppleDouble file
- From: Quinn <email@hidden>
- Date: Thu, 13 Nov 2008 10:33:19 +0000
At 16:39 -0800 12/11/08, Dave Camp wrote:
I'm writing some code to decode AppleDouble (._) files. It looks
like Entry 9 (Finder Info) has been expanded and contains some sort
of raw xattr data. Looking at a hex dump it appears to be a mixture
of binary data and UTF-16 text.
What I can't seem to find is what APIs can be used to take that
binary xattr data and either lookup attributes by name or restore
the data back to a file such that I could then use the normal BSD
getxattr calls.
The format is not properly documented. AppleDouble as a whole is
properly documented, but the hacks^H^H^H^H^H extensions used for
extended attributes are not. [The reason the extended attributes are
not stored in another AppleDouble chuck is that various old versions
of Mac OS X made bad assumptions about the format of AppleDouble
files, which meant we had to abuse one of the existing AppleDouble
chunks.]
If you're doing this work on a recent version of Mac OS X you can
unpack the AppleDouble file using <x-man-page://3/copyfile> (check
out the COPYFILE_UNPACK flag).
Beyond that, the options get kinda scary. If you can post a
description of your overall task, I might be able to offer further
suggestions.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
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