Closed GoogleCodeExporter closed 9 years ago
You might want to try this with the latest SVN. It seems to work on my machine,
at least:
$ echo "Hello world" > testfile.txt
$ xattr --set testxa testxavalue testfile.txt
$ xar -cf testfile.xar testfile.txt
$ rm testfile.txt
$ xar -xf testfile.xar
$ xattr --list testfile.txt
testfile.txt
testxa testxavalue
Original comment by Charle...@gmail.com
on 14 Mar 2007 at 11:21
Aha. Found the problem. Xar is only recovering the FIRST extended attribute. So
if a file has multiple extended
attributes or a resource fork and other extended attributes, only the first one
is restored.
Try the following:
$ echo "test" > test1.txt ; xattr --set foo bar test1.txt ; xattr --set foo2
bar2 test1.txt
$ echo "test" > test2.txt ; echo "resource fork data" >> test2.txt/rsrc; xattr
--set foo bar test2.txt ; xattr --set
foo2 bar2 test2.txt
$ xattr --list test1.txt test2.txt
test1.txt
foo bar
foo2 bar2
test2.txt
com.apple.ResourceFork resource fork data
foo bar
foo2 bar2
$ xar -cf test.xar test1.txt test2.txt
$ rm test1.txt test2.txt
$ xar -xf test.xar
$ xattr --list test1.txt test2.txt
test1.txt
foo bar
test2.txt
com.apple.ResourceFork resource fork data
This is off the HEAD revision of the SVN trunk.
Original comment by nik%inik...@gtempaccount.com
on 15 Mar 2007 at 5:10
I've just completely overhauled the way EAs are handled in xar, to fix some
fundamental issues. As part of the
fix, EAs in old archives won't be extracted properly. This doesn't seem to be
a huge issue with xarchives created
on Mac OS X, because of this bug.
However, this particular issue seems to have been related to a bug of incorrect
variable reuse causing (most
frequently, but not always) only the first EA returned by listxattr() to be
archived.
This should be fixed in r123 in trunk. Since this bug affected archival and
not extraction, you'll need to recreate
your xarchives so all the EAs will be captured.
Original comment by bbraun
on 17 Apr 2007 at 2:15
Since I believe this is resolved, I'm marking this as fixed. If you concur, it
can
be marked as verified. If you don't believe it is fixed, we'll move it back to
New.
Original comment by bbraun
on 18 Apr 2007 at 1:43
Original issue reported on code.google.com by
nik%inik...@gtempaccount.com
on 12 Mar 2007 at 9:42