• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ZIP archives
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ZIP archives


  • Subject: Re: ZIP archives
  • From: Nir Soffer <email@hidden>
  • Date: Tue, 25 Jul 2006 23:51:39 +0300


On 25/07/2006, at 22:24, Mike Abdullah wrote:

I am wanting to implement in my app the ability to create standard .zip archives. I have looked through the list archives and read various things on the internet, but I'm rather confused :(

I'm in the same situation. According to my research, these are the options:


1. Using Python zipfile - the easiest way but does not support resource forks:

    # zip the contents of folderPath in archivePath

    import os
    import zipfile

    prefixLength = len(archivePath)

    zip = zipfile.ZipFile(archivePath, 'w', zipfile.ZIP_DEFLATED)

    for root, dirs, files in os.walk(folderPath):
        for file in files:
            # You may exclude files here, change file archive name etc.
            fileName = os.path.join(root, file)
            archiveName = fileName[prefixLength:]
            zip.write(fileName, archiveName)

    zip.close()
	

2. Using ditto (is it available on every mac?):

	ditto -ckX "/path/to/folder" "/path/to/ArchiveName.zip"


3. Using minizip library, part of zlib distribution - did not check yet.

zip command line tool is annoying, I would not use it.


Best Regards,

Nir Soffer

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >ZIP archives (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Re: ZIP archives
  • Next by Date: Re: Why did I prefix the key of an NSSortDescriptor with "@"?
  • Previous by thread: Re: ZIP archives
  • Next by thread: Re: ZIP archives
  • Index(es):
    • Date
    • Thread