Re: ZIP archives
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>) |