1

I need to extract a tar.gz datastream in memory. An additional limit is that I cannot block.

Deflating in memory works great via zlib.

Now I need the untar part. Sadly all libraries I found either block or just work with tar files. Is there any library that works similarly to zlib?

abergmeier
  • 13,224
  • 13
  • 64
  • 120
  • Why are you trying to do this? – vonbrand Jan 31 '13 at 12:21
  • @vonbrand Because I need to extract a `tar.gz` on a server, without hitting the filesystem. – abergmeier Jan 31 '13 at 12:43
  • Maybe this can help: [Stack overflow answer to question][1] [1]: http://stackoverflow.com/questions/1553653/how-to-untar-file-in-memory-c-programming Look at the accepted answer. – Tyler Jandreau Jan 31 '13 at 13:13
  • @LCIDFire, that tells me (yet again) what you are _trying_ to do, not what the _problem_ to be fixed is. You can uncompress via a pipe, but to unpack the resulting tar stream gives its component files, what do you want to do with them, their permissions, the directories referenced? Unpacking a tar file isn't trivial either, so I suggest looking for an alternative approach. – vonbrand Jan 31 '13 at 16:24
  • @vonbrand The problem is that I need to 1. download a file, 2. extract a portion of it (which is a tar.gz) and then 3. to send the file content to a library. All without having access to the filesystem or being able to block. Please provide your constructive approach for this. – abergmeier Jan 31 '13 at 16:38
  • @LCIDFire, let me get this straight: Yoou want to (1) get , (2) extract from , (3) unpack and place its contents in ? What kind of contents? How many files? What is in step (3)? A directory, ...? Originally empty, filled with what? **Why** must all this be in-memory? **Could** you use other formats, other ways to transfer the data? In escence, what is your _problem_, as opposed to your solution attempt? What you propose is awfully contorted. – vonbrand Jan 31 '13 at 19:19

1 Answers1

0

Ok, there was no suitable library before. But now there will be, soon. Check it out here but be aware, that it is not yet working.

abergmeier
  • 13,224
  • 13
  • 64
  • 120