473,378 Members | 1,580 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,378 software developers and data experts.

Extract Zip With C++

Is it possible to extract a zip, rar, gzip, tgz, tar, etc. with C++?

Thanks in advance,
..::HardHackz::.

Mar 1 '07 #1
8 10985
On Mar 1, 2:41 pm, "HardHackz" <HardHa...@gmail.comwrote:
Is it possible to extract a zip, rar, gzip, tgz, tar, etc. with C++?
If you know the format, sure, why not?

Mar 1 '07 #2
On Mar 1, 2:44 pm, dave_mikes...@fastmail.fm wrote:
On Mar 1, 2:41 pm, "HardHackz" <HardHa...@gmail.comwrote:
Is it possible to extract a zip, rar, gzip, tgz, tar, etc. with C++?

If you know the format, sure, why not?
Well, I don't understand how I would do it...I don't know what command
or anything.

Thanks,
..::HardHackz::.

Mar 1 '07 #3
HardHackz wrote:
On Mar 1, 2:44 pm, dave_mikes...@fastmail.fm wrote:
>On Mar 1, 2:41 pm, "HardHackz" <HardHa...@gmail.comwrote:
>>Is it possible to extract a zip, rar, gzip, tgz, tar, etc. with C++?
If you know the format, sure, why not?

Well, I don't understand how I would do it...I don't know what command
or anything.
1. Read spec for ZIP format.
2. Write program as follows
a. Open zip file
b. Read zip file data
c. Decompress zip file data as specified in spec read in step 1
d. write uncompressed data.

ZIP file format is not discussed in ISO/IEC 14882, and is therefore
beyond the scope of this group, and left as an exercise for the reader.
Mar 1 '07 #4
HardHackz wrote:
On Mar 1, 2:44 pm, dave_mikes...@fastmail.fm wrote:
>On Mar 1, 2:41 pm, "HardHackz" <HardHa...@gmail.comwrote:
Is it possible to extract a zip, rar, gzip, tgz, tar, etc. with C++?

If you know the format, sure, why not?

Well, I don't understand how I would do it...I don't know what command
or anything.

Thanks,
.::HardHackz::.
E.g. for zgip compressed data you need the zlib installed and program it's
API.
Mar 1 '07 #5
HardHackz <Ha*******@gmail.comwrote:
Is it possible to extract a zip, rar, gzip, tgz, tar, etc. with C++?
Not directly (read: there is no standard function for that). However,
there are cross-platform third-party libraries that can do that for
certain formats, such as zlib.

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
Mar 1 '07 #6
HardHackz wrote:
On Mar 1, 2:44 pm, dave_mikes...@fastmail.fm wrote:
>>On Mar 1, 2:41 pm, "HardHackz" <HardHa...@gmail.comwrote:

>>>Is it possible to extract a zip, rar, gzip, tgz, tar, etc. with C++?

If you know the format, sure, why not?


Well, I don't understand how I would do it...I don't know what command
or anything.

Thanks,
.::HardHackz::.
It's possible to do it yourself, but why bother when others have already
done it for you, http://www.zlib.net/

A lot of C++ programming is like this. Unlike Java or C# which come with
huge libraries of all sorts of stuff built in, C++ programmers rely much
more on third party libraries to get basic stuff done (like reading zip
files).

john
Mar 1 '07 #7
Hi,

You might want to look into http://www.7-zip.org/
Basically uncompressing/compressing is done by linking to a library or DLL
that already got that functionality (though you could always program it
yourself just for the fun of it of course).
An alternative is the zlib or bzip2 library itself which is quite easy to
use.

Download the sources, create seperate projects compile into static zlib.
Link with any other program. Include de directory in the C++ tab. Include
the library directory in the linker tab add the library itself to the linker
input.

With zlib it as easy as opening a file. Instead of fopen use gzopen instead
of close gzclose. Instead of 'wb' as open parameter for reading you could
use something like 'wb9'. I t won't get any easier :-).

Bzip2 can do the same thing throw everything in a buffer and compress.
Regards, Ron AF Greve

http://www.InformationSuperHighway.eu

"HardHackz" <Ha*******@gmail.comwrote in message
news:11**********************@z35g2000cwz.googlegr oups.com...
Is it possible to extract a zip, rar, gzip, tgz, tar, etc. with C++?

Thanks in advance,
.::HardHackz::.

Mar 2 '07 #8
On Mar 2, 12:41 am, "HardHackz" <HardHa...@gmail.comwrote:
Is it possible to extract a zip, rar, gzip, tgz, tar, etc. with C++?

Thanks in advance,
.::HardHackz::.
Firstly you have to be specific about the compiler you are using and
the platform as its not discussed in ISO C++ draft. But if you have to
do it then use APIs from any good compiler(like VC++) which would the
job for you.

Mar 3 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Don Crossman | last post by:
Assume a MYSQL table, foo. One column, bar datetime. Two rows: 2004-01-01 08:00:00 2004-02-01 08:00:00 select * from foo where extract(day from bar)=1; 2 rows in set...
3
by: Phong Ho | last post by:
Hi everyone, I try to write a simple web crawler. It has to do the following: 1) Open an URL and retrieve a HTML file. 2) Extract news headlines from the HTML file 3) Put the headlines into a...
9
by: Sharon | last post by:
hi, I want to extract a string from a file, if the file is like this: 1 This is the string 2 3 4 how could I extract the string, starting from the 10th position (i.e. "T") and...
10
by: Robert Schultz | last post by:
I have a C/C++ file that I simply want to 'extract' a function from. Something like: extract <function name> <c or cpp file> I want it to return from the beginning of the function, to the end. ...
6
by: Mohammad-Reza | last post by:
Hi I want to extract icon of an exe file and want to know how. I look at the MSDN and find out that I can use ExtractIconEx() Windows API but in there are some changes to that api in c# I made...
3
by: jarod1701 | last post by:
Hi, I'm currently trying to create a regular expression that can extract certain elements from a url. The url will be of the following form: http://user:pass@www.sitename.com I want a...
8
by: Fabian Braennstroem | last post by:
Hi, I would like to remove certain lines from a log files. I had some sed/awk scripts for this, but now, I want to use python with its re module for this task. Actually, I have two different...
2
by: kimi | last post by:
Hi ppl, I am new to PHP. I would need some information on the following: 1. a) I wanted to know from where the data is extracted and stroed in the global assocoative arrays ( specifically...
1
by: rcamarda | last post by:
I'd need to have a function that allows me to extract 'fields' from within the string I.E. (kinda pseudo code) declare @foo as varchar(100) set @foo = "Robert*Camarda*123 Main Street" select...
5
by: Steve | last post by:
Hi all Does anybody please know a way to extract an Image from a pdf file and save it as a TIFF? I have used a scanner to scan documents which are then placed on a server, but I need to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.