Zip Extractor

This is a discussion on Zip Extractor within the C++ Programming forums, part of the General Programming Boards category; Hey everyone. I found a while back a zip file containing a bunch of example programs that someone made to ...

  1. #1
    harryp
    Guest

    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

  2. #2
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    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.
    Attached Files Attached Files
    The world is waiting. I must leave you now.

  3. #3
    harryp
    Guest
    Thanks very much!

    Brendan

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 06-25-2009, 03:56 PM
  2. Downloading ZIP
    By abraham2119 in forum C Programming
    Replies: 8
    Last Post: 05-05-2009, 05:02 PM
  3. opening a zip file
    By smooth in forum C Programming
    Replies: 8
    Last Post: 12-16-2008, 07:32 AM
  4. C libraries for unpacking zip and rar
    By OnionKnight in forum Tech Board
    Replies: 0
    Last Post: 02-23-2008, 11:16 AM
  5. send zip file via socket
    By WaterNut in forum C Programming
    Replies: 11
    Last Post: 05-24-2005, 11:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21