FROM : Nir Soffer
DATE : Tue Jul 25 22:51:39 2006
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
DATE : Tue Jul 25 22:51:39 2006
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
| Related mails | Author | Date |
|---|---|---|
| Mike Abdullah | Jul 25, 21:24 | |
| Alan Smith | Jul 25, 21:35 | |
| Scott Thompson | Jul 25, 21:38 | |
| I. Savant | Jul 25, 21:39 | |
| Nick Zitzmann | Jul 25, 22:08 | |
| I. Savant | Jul 25, 22:19 | |
| Joshua Scott Emmon… | Jul 25, 22:31 | |
| Nir Soffer | Jul 25, 22:51 | |
| Matt Mashyna | Jul 26, 00:24 | |
| Michael Hall | Jul 26, 00:44 | |
| Ryan Britton | Jul 26, 01:02 | |
| Dragan Mili? | Jul 26, 08:29 | |
| Mike Abdullah | Jul 26, 13:44 |






Cocoa mail archive

