Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best library to work with archives [closed]

I wonder, what library you would choose for the following: I need to be able to combine a bunch of files and folders (a tree of filesystem structure) into one file - archive, thus having one composite file.

  • the library must be cross-platform: Windows 7 and Linux
  • it must provide access to the content and ability to extract only one file (e.g. if I have an archive of data folder and if I need only data/subdata/file, only it should be extracted)
  • it must have C++ (preferably) or C API
  • I am not particularly keen on archiving, but it would be desirable, since I will be storing mostly text files and they compress well...

Any feedback is highly appreciated!

like image 686
Serge Avatar asked Sep 05 '25 17:09

Serge


2 Answers

zlib in combination with Boost Iostreams is a great combination. This does not do file level extraction though.

EDIT: Some other options I found via another SO question include:

  • Zipios++
  • QuaZIP - Requires QT, may not build on Windows correctly

EDIT2:

  • Minizip (usually included with zlib) will do the trick too - probably the most lightweight and commonly used solution.
like image 193
Soo Wei Tan Avatar answered Sep 09 '25 21:09

Soo Wei Tan


Consider libarchive.

http://gnuwin32.sourceforge.net/packages/libarchive.htm

like image 21
Ben Avatar answered Sep 09 '25 19:09

Ben