Hi,

Just my $0.02. Mostly I totally agree with Rugxulo, who evidently knows 
much more about stuff than he modestly pretends ;)

This have not much to do with the initial OP's question, but 
nevertheless, archiving is an interesting topic :) - for me especially, 
since I had to do much work with zip/gzip/deflate/lzma for FDNPKG.

On 08/30/2013 06:42 AM, Rugxulo wrote:
> IIRC, the default mode of 7za is -mx5 and .7z format using LZMA [or
> LZMA2 in newer alphas] method, which means (among other things) 16 MB
> dictionary, aka 2^24, aka LZMA:24 (but you can adjust that, e.g.
> "-ms=32m -m0d=32m" [LZMA:25] seems to compress slightly better, if the
> file is bigger than 16 MB).

This is right. But "bigger dictionary" doesn't necessarily mean 
'better'. well, sure, it means 'potentially better compression ratio', 
because we can seek back redundant data in wider spans, but it also 
means 'tremendously higher memory requirements'. This is why I don't 
create FDNPKG packages using LZMA (unless for pure experimentation), 
even though it's 5-15% smaller than DEFLATE. Trying to uncompress an 
LZMA file on a <16MB RAM machine is hell (or simply impossible if no 
virtual memory is available).

> Even .ZIP format can officially support Bzip2 or even LZMA
> method (or others).

That's exactly what FDNPKG supports - LZMA-compressed files inside ZIP 
'slots'. This allows using the cool ZIP structure for handling files 
(and extracting only these we need - eg. without SOURCES), but still 
benefiting from the LZMA compression ratio.

> .gz seems mostly to be meant for streaming as it doesn't really
> support anything beyond a very minimal header. Though of course I
> think? you can concat several .gz files, and it will still decompress
> them all correctly, but that's rare (in my limited experience).

indeed, .gz is designed to compress only a single file. No 'directory 
storage' capabilities there. Still, for 'single file' compression I'd 
use gzip over zip anytime. It's fits better, because it provides all we 
need, without any additional garbage (mostly limited to filename + CRC32 
+ a few flags). BTW, in a future version, FDNPKG will support 
gz-compressed index files (provides integrity and faster refreshing time 
of online repositories!)

> "Usually" but not always. 7-Zip provides its own "improved" Deflate,
> which is slightly better (tries harder, gives up less easily) than the
> algorithm typically used in such encoders.

True again. And actually, I use 7za myself to create all FDNPKG packages 
(as zip files, with deflate), because as you say, it provides a (small) 
improvement over eg. info-zip. like 5-8% or so.

On a side note: some decompressors have troubles handling the 7zip 
'deflated zip' files sometimes. For example kunzip crashes on some zip 
files created by 7za, while it doesn't crash on any other files created 
with 'classic' zippers.

> It's easy but not totally super duper simple to add or remove because
> you still have to disassemble and reassemble the archive if you insert
> or delete anything, not to mention updating the (overall) central
> directory structure (CDS) at the end. And potential .ZIP comments make
> that even slightly harder.

Well, adding is easy (you just strip the directory from the end, append 
your file and recreate the directory).
Deleting is trickier, indeed.. (need to move all data around to cover 
the empy hole left by the deleted file, and recalculate all data offsets 
in both the central directory and per-file headers...).

regards,
Mateusz


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Freedos-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to