-
Zip Extractor
Hey everyone. I found a while back a zip file containing a bunch of example programs that someone made to help answer some faqs by newbies. Well, one of the examples was a zip program or something. What I'm wondering is, does anyone know of a way to make a program that can extract files from a zip folder and store them in a different directory? I'm truly stumped on this, so any help would be greatly appreciated. Also, I've tried to find that file with all the examples and I don't have them anymore, nor can I find it on the web anymore. Thanks in advance!
Brendan
-
Code:
void ZipCheck ( char * FileCheck, char * Name )
{
FILE * Tmp;
if ( ( Tmp = fopen( FileCheck, "r" ) ) == 0 )
{
printf("%s not found, skipping.\n", Name);
}
else
{
/* Nothing */
}
fclose(Tmp);
}
void ZipExtract ( char * SourceFile, char * Destination, char * Name )
{
char * args[6];
args[0] = " -qq "; /* makes unzip.exe quiet */
args[1] = " -C "; /* make unzip.exe noncase-sensative */
args[2] = SourceFile;
args[3] = " -d "; /* create new subdirectory for file(s) */
args[4] = Destination;
args[5] = NULL; /* more output supression to unzip.exe */
printf("Copying..");
spawnv( P_WAIT, "d:\\unzip.exe", args );
printf("\b\b\b\b\b\b\b\b\bCopied - %s\n", Name);
}
You'll need the zip program found here.
This source file, is in C, and requires the use of an outside zip extracting programming, however.
The zip is attached.
* If I'm not the person you're talking about, woops.
-
Thanks very much!
Brendan