Page 1 of 1

gzip anyone?

Posted: Mon Dec 20, 2010 5:49 am
by GBeebe
I thought I saw this once, but after searching the forums I haven't been able to find it. What I'm looking for is sample code that will let you let you extract a file (by name) from a zip into memory. The only thing I've been able to find, however, code to use wrappers that use gzip instead of actual code that uses gzip directly. I would have sworn I saw it here in the linux forums, but searching for "zip" turns up nothing and searching for "gzip" doesn't turn up much. I'm sure someone has this sitting on their harddrive and I would love to see it.

Re: gzip anyone?

Posted: Mon Dec 20, 2010 1:33 pm
by Trond
gzip
extract a file (by name) from a zip into memory
Zip or gzip? You know gzip can't contain multiple files, right? So you can't extract "one of the files" in it, as there is only one (usually a tar file, which can contain multiple files, but offers no compression on its own).

Re: gzip anyone?

Posted: Mon Dec 20, 2010 1:52 pm
by IdeasVacuum
...you might be thinking of PureZip, but I think that is Windows only.....

Re: gzip anyone?

Posted: Mon Dec 20, 2010 5:46 pm
by Trond
You can use RunProgram() to call gzip and with the right parameters it will output to a pipe which can be read with ReadProgramData().

Re: gzip anyone?

Posted: Wed Dec 22, 2010 5:09 am
by GBeebe
I guess I didn't see it here then. I didn't figure it was going to be that easy. Looks like I have some research to do. Thank for the pointers guys.