How to read the content of zipped file without unzipping in C++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Man4ish
    New Member
    • Mar 2008
    • 151

    How to read the content of zipped file without unzipping in C++

    Hi,

    I am working on one application in which i need to read the contents of one file test.tar.gz which has 50000 files. I know the names of files inside but i don't want to unzip it. I want C++ program to read the file test.tar.gz and read the content of one of the file ( let' day sample1.txt ), so that it can be very fast. How can i do it? Please help.

    Thanks
  • newb16
    Contributor
    • Jul 2008
    • 687

    #2
    zlib library - gz* functions in zlib on the other hand use the gzip format.

    Comment

    • Man4ish
      New Member
      • Mar 2008
      • 151

      #3
      Thanks, I am going through it. Is there any statistics how much time it will take to search file in directory if i know the name of the file. Please reply.

      Regards

      Comment

      • newb16
        Contributor
        • Jul 2008
        • 687

        #4
        In tar archive, file names are stored along with file data - so if the file of interest is the last in the archive, you will have to unzip the whole archive until you reach the last file name.

        Comment

        Working...