Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

7-Zip: Any good tutorials? [closed]

Tags:

c++

c

7zip

I'm thinking about using the 7-Zip format to pack my application files since it's a very compact and popular format. I can't find some tutorials on how to use the C++ SDK, though. I'd like some tutorials that teach me how to:

  • Open an archive from memory (buffer) instead of directly from disk.
  • Extract individual files inside the archive, to buffer, not to disk.
  • Check if a certain file can be found in the archive.
like image 748
Paul Manta Avatar asked Jun 03 '11 11:06

Paul Manta


People also ask

Can 7-Zip be trusted?

It is safe to use 7-Zip for file compression. With it, you can compress or decompress files without interruption. However, when you use the file compression tool, you should know what files should be compressed or you will find that your computer runs slow.

Is 7-Zip better than RAR?

While both are compression programs, 7-Zip can compress files into a wider range of format types, including 7z. WinRAR can only compress into RAR or ZIP formats. However, both can decompress a wide variety of format types. Also, 7-Zip is open source and free, while WinRAR costs over $30 for a lifetime license.

Is 7-Zip better than WinZip?

The answer is simple: it's because you can do so much more with WinZip and you can do it faster, better and with ongoing support for even more productivity and convenience features. WinZip vs 7-Zip is no match: WinZip is a more versatile, powerful, and simpler alternative to 7-Zip.

Which 7-Zip compression method is best?

For the best compression rate, choose 7z. Compression level — the compression time increases with the compression level. The presets range from Store (fastest compression) to Ultra (slowest compression time with the most space saved).


1 Answers

From the LMZA SDK documentation:

ANSI-C LZMA Decoder

~~~~~~~~~~~~~~~~~~~

Please note that interfaces for ANSI-C code were changed in LZMA SDK 4.58. If you want to use old interfaces you can download previous version of LZMA SDK from sourceforge.net site.

To use ANSI-C LZMA Decoder you need the following files: 1) LzmaDec.h + LzmaDec.c + Types.h

LzmaUtil/LzmaUtil.c is example application that uses these files.

The example app should have everything you need, else the actual source for 7-zip will have what you need. There is also a C++ wrapper for 7-zip here which should simplify a lot of the needed ops.

like image 69
Necrolis Avatar answered Oct 11 '22 18:10

Necrolis