News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Raymond Chen: Why is Zip folders support stuck at the turn of the Century?

Started by jj2007, April 25, 2023, 08:52:48 PM

Previous topic - Next topic

jj2007

Quote from: morgot on April 29, 2023, 09:56:47 PM
I also don't understand why winapi doesn't have any ZIP-archiving function. There is a lot of garbage like "infrared sockets", but this is not. There is rtldecopressbuffer api, which is absolutely stupid and incompatible with anything.

Yes, that's the point, Morgot :thumbsup:

Thanks for pointing me (indirectly) to RtlCompressBuffer - looks interesting :rolleyes:

Marpon's code looks good. However, RtlCompressBuffer doesn't seem that useful:
QuoteCraig_Barkhouse
April 2010
RtlCompressBuffer() implements LZNT1 compression. It's fast enough and good enough, though not great. You can only compress up to 64K at a time (hardcoded limit), which really limits the overall compression ratio you can achieve when compressing a large stream. This is the compression routine that NTFS uses for its compression feature. NTFS compresses a file in units of up to 64K at a time, which jives nicely with the hardcoded limit in RtlCompressBuffer().

Explorer's "Send to compressed (zipped) folder" feature simply creates a .zip file, using the public domain ZIP format.

CABARC creates .cab files, which use the Cabinet format. Cabinet is a proprietary Microsoft format which is most definitely not the same as the ZIP format. The codec options (MSZIP, LZX) are also proprietary Microsoft formats and not the same as those used in ZIP. MSZIP is based on Huffman, while LZX is based on Lempel-Ziv and is generally much better than MSZIP. Note that Cabinet takes advantage of cross-file compression (giving Cabinet a compression advantage over ZIP), whereas ZIP compresses each file individually (giving ZIP a speed advantage when extracting a single file).

HSE

Equations in Assembly: SmplMath

jj2007

Interesting, but apparently you still need to handle the composition of the zip archive, which is not trivial.

daydreamer

That ntfs compression paper reminded me of ntfs compressed folder on PC copied to my Android tablet got zipped in there
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

morgot

Hello, jj2007

This feature is useful when passing data from MS Windows to another Windows. And if you need to decrypt on Linux / Web/ etc? I didn't find an algorithm that decodes api RtlCompressBuffer. As I know, LZNT is a proprietary MS format. Same as .CAB.
Sorry for the bad English

jj2007

Just stumbled over a strange phenomenon:
- there used to be an option to add a comment to a zip file, and it was stored with the file
- not so with 7-zip: it creates a file Descript.ion, which is a really ugly method
- however, comments to individual files are stored with the archive, and they crash Ibsen's tinf library*)

WinZip:
A comment is optional text information that is embedded in a Zip file

*) P.S., under the hood:
Cß7âƒÙCommentPK?

The start of the decoding buffer should have the PK (Phil Katz) string, but it actually points at "Comment".

jj2007

I've installed the WinZip trial now. It eats up gigabytes of disk space and has a horrible, overloaded ribbon interface, but it handles the by-archive comments correctly. The installation adds over one MB of crap to the registry, and adds or changes several hundred registry entries.

mineiro

I was reading about this:
https://blogs.windows.com/windowsdeveloper/2023/05/23/bringing-the-power-of-ai-to-windows-11-unlocking-a-new-era-of-productivity-for-customers-and-developers-with-windows-copilot-and-dev-home/

windows 11
Quote
We have added native support for additional archive formats, including tar, 7-zip, rar, gz and many others using the libarchive open-source project. You now can get improved performance of archive functionality during compression on Windows.

I think this will be the path to follow.
https://www.libarchive.org/
https://github.com/libarchive/libarchive/wiki/Examples
I'd rather be this ambulant metamorphosis than to have that old opinion about everything