473,386 Members | 1,654 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

151 100+
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
Jan 23 '10 #1
3 2471
newb16
687 512MB
zlib library - gz* functions in zlib on the other hand use the gzip format.
Jan 23 '10 #2
Man4ish
151 100+
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
Jan 25 '10 #3
newb16
687 512MB
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.
Jan 25 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: lamar_air | last post by:
I have a python script and i want to delete a file on my computer c:\....\...\.. .txt what's the script to do this? I know how to write to files but i also need to know how to delete a file.
0
by: Franz, Fa. PostDirekt MA | last post by:
Dear Ladies and Sirs, can anyone give me a hint please, if it is possible toimport data data from a zipped File, without unzipping it before. I'm using MySQL 3.23 on a LINUX System. I guess it...
2
by: Brian Vallelunga | last post by:
Greetings, I'm attempting to create a tabbed box with CSS and Javascript and am having some problems. I have three tabs and three tab content areas. When the page is loaded, two of the three...
3
by: John | last post by:
Is there anyway open a socket so that every send/listen/recv goes thru a zipping/unzipping process automatically? Thanks, --j
2
by: Mark | last post by:
Hi there, I have two xml files, one is a master file and the other is just a fragment of xml. Master xml file uses 'DOCTYPE' to define the other file as an entity. Then, the master uses entity...
10
by: Yogi_Bear_79 | last post by:
pardon my ignorance as I am a self-taught hobbyist programmer. I am curious after reading up on SharpZipLib. Can I embed a zipped txt file in my program? Then either read from within the zip...
2
by: yinglcs | last post by:
How to modify the source of a python file inside a python egg file? I can see the file by unzipping it, but how can I package it back as a python egg file after my modification. Thank you.
1
by: Paul Smith | last post by:
Hi, I'd like to read a series of sqlite database files that have already been gzipped and was wondering if this can be done on the fly. In other words, can I avoid explicitly unzipping the file...
2
by: Alan G Isaac | last post by:
I have a large ASCII data set that is zipped to a reasonable size. Can I access the data without decompressing the whole file first? I would like to run through the data to produce a much smaller...
1
by: 7seven7 | last post by:
Once i zipped my file a simple .xls spread sheet i write it to a database ... evoking the toArray() method of the memory stream, however now trying to recover this zipped file it doesn't display the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.