.zip vs .tar.gz

Paul Sargent psarge at gmail.com
Mon Mar 31 02:25:05 PDT 2008


On 28 Mar 2008, at 23:28, Karl Kuehn wrote:
> On Mar 28, 2008, at 4:19 PM, J. Todd Slack wrote:
>
>> I have a bunch of old data that I want to compress up but still  
>> keep on my system.
>>
>> So .zip vs .tar.gz?
>>
>
> 	If you are on 10.5, and can be sure you don't have to uncompress  
> the files on random other platforms (Windows is problematic at this  
> point), then you might also want to look into rar. It has the  
> benefits of both gz and zip (and beats tar by a lot).

Are you sure you don't mean 'xar'? If you do then I agree it's worth a  
look. It's used as the new installer archive format in 10.5. 'rar' is  
a zip like format that dates back over 15 years.

Xar currently appears to be the only archive mechanism that stores all  
the extended attributes and resource forks.

http://www.n8gray.org/blog/2007/05/07/xar-rox/

It's terminal only at the moment(1), but quite simple:

To create  an archive: xar -cf archive.xar directory_to_archive/
To extract an archive: xar -xf archive.xar

It defaults to gzip compression, but can use bzip2 if you put '-- 
compression bzip2'
It can also store just one copy of identical files: '--coalesce-heap'

In general it works in a very similar way to tar, but it's very good  
with metadata, and it's quick if you want to extract individual files  
out of an archive (as it puts a catalogue at the start of the file).

A couple of negative points:
  * As it stores all the metadata on a file it can produce slightly  
larger archives, but the difference is small.
  * If you archive a large tree it can use a large amount of memory as  
it builds the catalogue in RAM.

Paul

(1) There is http://www.apimac.com/compress_files/ if you want a GUI,  
but there's a price associated. Also there's code for a quick look  
plugin on the google code page for the project http://code.google.com/p/xar



More information about the MacOSX-talk mailing list