[Pythonmac-SIG] Resource forks and HFS-metadata
charles at nemetschek.net
Wed Jan 18 17:40:06 CET 2006
I use ditto to create zips...
openObj = popen2.Popen4('ditto -c -k --keepParent -sequesterRsrc ' +
sourceFolderName + ' ' + targetZipName)
...then the zipfile method to unzip the files...
data = theZipFile.read(relPathAndFileName)
outfile = open(fullTargetName, "wb")
...then a Mac BSD call to rebuild the data and resource forks...
popen2.popen2("/System/Library/CoreServices/FixupResourceForks \"" +
destination + "\"")
...assuming that the developer tools are installed.
> -----Original Message-----
> From: pythonmac-sig-bounces+charles=nemetschek.net at python.org
> [mailto:pythonmac-sig-bounces+charles=nemetschek.net at python.org] On Behalf
> Of Henning Hraban Ramm
> Sent: Wednesday, January 18, 2006 10:52
> To: pythonmac-sig at python.org
> Subject: Re: [Pythonmac-SIG] Resource forks and HFS-metadata
> Am 2006-01-18 um 02:01 schrieb Dimi Shahbaz:
> > My program deals with zip transferring archives. I'm curious as to
> > whether Python (namely the 'zip' and 'zipfile') modules can be made
> > to be aware of resource forks and HFS-metadata? Or is this a
> > limitation of the zip format itself? According to this (old) hint:
> I experienced that the zipfile module doesn't work at all (at least
> in Python 2.3); the files were often broken (i.e. no other zip
> program could open them), and it couldn't handle a lot of zip files
> by other apps.
> AFAIK the only *known* limitation is with really huge files, though.
> Thus I always use an external app for archive handling, even if I
> don't like that approach.
> Grüßlis vom Hraban!
> http://www.cacert.org (I'm an assurer)
> Pythonmac-SIG maillist - Pythonmac-SIG at python.org
More information about the Pythonmac-SIG