C/How read text file inside Archive files by 'C '
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] 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]
I tried to open the text file inside Archive,but it's unable to open it.
Possibly I am looking forward to [zlib] 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.
Based on your requirements libarchive looks like a good choice. libarchive is an opensource library that supports both rar and zip. The libarchive github page has good documentation with examples: https://github.com/libarchive/libarchive/wiki/Examples#A_Complete_Extractor