Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unix system programming - unzipping a file programmatically

What I need to do is unzip a file, (.gz or .z), read the first line and do some stuff according to the first line read. But the C standard library doesn't seem to offer a way to do this.

Is the a platform-independent way to do it?

like image 398
helpermethod Avatar asked Sep 28 '26 22:09

helpermethod


1 Answers

Use "zlib", the library that performs compression and decompression:

http://www.zlib.net/

It's included in the base of all Unix distributions, and you can easily link your program against it for the windows version and ship the DLL.

like image 155
Zorglub Avatar answered Sep 30 '26 11:09

Zorglub