On Thu, 04 Sep 2003 15:54:57 +0200, rumours say that "T. Kaufmann"
<me****@snafu.d e> might have written:
Hi there,
in my directory are some 'normal' files like *.py sources and some empty
directories too. How can I put all togehter into a zip-archive?
There is no problem to zip the *.py files but if I try to add empty directories
an exception is trown.
This is not a direct reply to your problem, but just my 2 eurocents of
information gathered the last five minutes.
Creating a zip file with an external program, one can see that the zip
format seems to include directories, empty and non-empty (or so the
zipfile module helps us discover, when reading the externally created
zip file).
The only difference I found out so far is that the external_attr is
2172649504L (0x81800020) for files and 1103101968 (0x41c00010) for
directories. Perhaps it's a bug in the zipinfo module, but I can't
check SF at the moment.
z= zipfile.ZipFile ("c:/temp/ax.zip")
for fi in z.infolist():
print fi.filename, fi.external_att r
--
TZOTZIOY, I speak England very best,
Microsoft Security Alert: the Matrix began as open source.