How to read text files inside Archive file format (Rar/Zip) without extracting the Archive file using 'C' only?

I have tried finding the solution for the problem on google but unable to find a solution that supports both the Archive formats i.e Rar/Zip.I tried with 7zip [7zip][1] but it has functions thar compress/decompress or extracts the contents of Archive files , While searching for the solution I found minizip supports both the formats Rar/Zip with [minizip][2]

I tried to open the text file inside Archive,but it's unable to open it.

Possibly I am looking forward to [zlib][3] as a possible approach but it is a dll,and I dont know about how its functions work and do they perform the task of reading from a text file inside the Archive.

So, please give guidance as how to move ahead in this task, i am not sure with zlib.

**Making the requirement clear again**

I just want to read the content of text files inside archive (rar/zip) For e.g I have Archive C:\Test.rar and Test.rar contains filesample.txt , so my requirement is to read the content of filesample.txt directly ,I dont want to extract the files.


[1]: http://sourceforge.net/projects/sevenzip/files/LZMA%20SDK/lzma920.tar.bz2/download?use_mirror=kaz/%227zip%22
[2]:http://code.google.com/p/miniz/downloads/detail?name=miniz_v115_r4.7z
[3]: http://www.winimage.com/zLibDll/minizip.html//%22%22
Last edited on
unrar and zlib does support extracting files as a stream, in fact all archiving libraries does support that.

At least unrar decompress the files inside archive chunk by chunk, using a user defined callback function where you can process uncompressed data, including doing nothing.
Topic archived. No new replies allowed.