Wednesday, January 31, 2007

path archival problem

If you run: xar -cf foo.xar /path/to/file, and extract it again, what do you expect to happen?
In all versions up to current trunk in subversion, xar would non-recursively archive path and path/to, so when you extract the above archive, you'd get path/to/file with all aspects of path and path/to preserved. Unfortunately, when path or path/to is a symlink, this causes problems. If path/to is a relative symlink pointing to path/from, and you extract the archive, it will fail to extract because path/from doesn't exist, and therefore can't create path/to/file.

With tar, path and path/to are not archived at all. The fact that file existed in path/to/ is preserved, but those directories are not archived. This avoids the problem entirely, although might not be what you're thinking of when you type tar cf foo.tar /path/to/file.

One alternative to tar's approach is to have a flag to xar that tells it to treat symlinks to directories (xar knows what type of file a symlink was pointing to at the time of archival, if anything), and extract it as a directory instead of a symlink. However, this is problematic in the case of xar -cf foo.xar /path/to/dir, where path/to/dir/link points to a directory, but you wanted to preserve the symlink.

It seems tar's approach makes the most sense here, and it's hard to go wrong following the behavior of such a well established and well known tool.

Monday, January 29, 2007

chflags support added

Initial chflags(2) support has been added to the repository. This support has not been integrated with the ext2 flags support, although there is some feature overlap. This has been tested on Mac OS X 10.4 and Fedora Core 5 i386. Please feel free to test and let the list know how it goes.

To elaborate on chflags(2) vs ext2 flags, here is what each looks like in the toc:
ext2 flags:

<NoDump fstype="ext2"/>



Clearly nodump has similar meaning between these two representations. The obvious desire is to have a mapping engine within xar "just know" that chflags nodump is the same as ext2's nodump. Similar with some of the immutable bits.

Sunday, January 28, 2007

API Documentation updated

The API documentation has finished its migration from the web pages on opendarwin to the xar project wiki.
All the documentation should be reasonably up to date on the project wiki.

I've also created a xar-bugs googlegroup and am sending all of the Issue updates to the group. Feel free to subscribe to avoid missing out on all the juicy bug goodness.

Wednesday, January 10, 2007

xar move to

xar is moving from OpenDarwin to hosting and is now located here:
The intent of this blog is to post xar discussion, features, and design considerations.

Currently, progress is being made on transcribing the API documentation from html pages to the wiki at
The xar code has been imported into the repository, and the 1.4 release tarball and xarball are now available from the project download section.
There are 2 google groups for the xar project, one for discussion, and one that receives commit messages from the subversion repository.