Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to read text files from a rar/zip file but unable to do so, I have tried with three approaches but none of them seems to work. First i tried to use the library available from this link http://www.unrarlib.org/download/unrarlib040.exe . 
It's a code written in 2002 so does not support latest archive files, second I tried with the code available from 7-zip website for windows, but that also not works and throwing an error when i try to retrieve the contents of rar files and then i tried with C code to open and read files that also results in not reading the text files inside archive files.So , please guide me in order to achieve it..provide some useful links or steps i.e guidance to do so??

Thanks for your help in advance.
Posted
Comments
Mohibur Rashid 6-May-14 3:20am    
7-zip suppose to work
Ashish Tyagi 40 6-May-14 8:47am    
When you tried 7z's C API to open the file, what was the error?
What is the file format zip or rar?
Are you able to extract these files using 7z.exe utility or winrar?
Dhawal Arora 7-May-14 1:22am    
The file format was rar..and 7zDec.exe was unable to list the archive files failing with error 17. Also, 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 filesam.txt , so my requirement is to read the content of filesam.txt directly ,I dont want to extract those files.
[no name] 16-May-14 14:25pm    
Don't use RAR. Switch to a format supported by zlib or 7zip. Sometimes the best solution is to avoid the problem.

1 solution

The project unrarlib is inactive. Don't use it, use any othe alternatives. Use 7-zip instead as it supports RAR files. Also check whether there is no error in the RAR File. Visit this page:
http://www.example-code.com/vcpp/rar_unrar.asp[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900