3

I need to extract a large gzip data stream in C++ (on Linux) into memory. I intended to use libarchive, but I have the limit that I cannot block or use any kind of synchronization.

AFAIR in order to use libarchive's custom reader it has to block, till data is available.

So I would like it to have the other way around. A library, which has callbacks for entries/progress and the ability to put data in manually.

Is there any library out there that does this or is it faster to modify libarchive to work the other way around?

abergmeier
  • 13,224
  • 13
  • 64
  • 120

1 Answers1

1

If it's just gzip decompression you need and not tar extraction, then you can use zlib. It is likely already on your system as zlib.h (which is also the documentation) and libz.so.

If you also need tar extraction, then you can try libtar.

Mark Adler
  • 101,978
  • 13
  • 118
  • 158
  • The thing is, I do need tar extraction. Is there an easy stream based library for this? – abergmeier Jan 31 '13 at 08:47
  • I think this is a valid answer, since zlib does at least half of what I try to do. I asked another question [here](http://stackoverflow.com/questions/14622669/extract-tar-in-memory-and-nonblocking) to perhaps also get the tar part done. – abergmeier Jan 31 '13 at 09:46