Re: Decoding xattrs in an AppleDouble file
Re: Decoding xattrs in an AppleDouble file
- Subject: Re: Decoding xattrs in an AppleDouble file
- From: Dave Camp <email@hidden>
- Date: Thu, 13 Nov 2008 09:13:17 -0800
On Nov 13, 2008, at 2:33 AM, Quinn wrote:
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.]
Ah! I was wondering why Apple didn't just use another chunk...
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.
Our app, which is running on the iPhone, has a WebDAV server. When a
Mac copies up a file it gets AppleDoubled, and the Mac successfully
reassembles files on download. All that works fine and dandy. We've
thought about reassembling the files on the phone but that seems
unnecessary as leaving them split is more efficient and works well. I
don't think we want to change that.
Our iPhone UI would like to display some of the meta-data that is
being stored in the xattrs (comments, etc). Thus, I was hoping there
was an API for taking that blob of data from Entry 9 and turning it
back into something useful (ala getxattrs).
If there is no API for that, is the code that writes Entry 9 posted in
the Darwin repository? I would not be opposed to writing some code to
extract what we need if I knew the data format...
Thanks,
Dave
_______________________________________________
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