add empty directory using zipfile?

JanC usenet_spam at janc.invalid
Thu Jun 26 09:08:57 EDT 2003


Ben Finney <bignose-hates-spam at and-zip-does-too.com.au> schreef:

> A better solution might be to use tar (or cpio) for archiving, since
> they can add directories as well as files, and can also preserve file
> permissions from Unix filesystems.
> 
> You then get the benefit of choosing whatever compression method you
> like for the resultant archive.  gzip and bzip2 both offer superior
> compression to the built-in compression for Zip.

You can use bzip2 compression in a zip file (it's in the recent specs), but 
probably not with zipfile, and most zip utilities can't uncompress it 
anyway.

A disadvantage of .tar.whatever is that it is stream-based: no random 
access to a single file in the archive...

-- 
JanC

"Be strict when sending and tolerant when receiving."
RFC 1958 - Architectural Principles of the Internet - section 3.9




More information about the Python-list mailing list