By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,676 Members | 2,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,676 IT Pros & Developers. It's quick & easy.

Re: Writing Empty folders into ZipFile

P: n/a
ot*****@o2.pl schrieb:
Hello.

I'm having situation writing folders structure into
a zip file. Folders contain no files.

Is it possible to do in python ?
As far as I remember the zip format it's not possible at all. Folders
are created implicitly. The zip format doesn't support empty directories.

Christian

Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Jun 3, 10:03 am, Christian Heimes <li...@cheimes.dewrote:
otae...@o2.pl schrieb:
Hello.
I'm having situation writing folders structure into
a zip file. Folders contain no files.
Is it possible to do in python ?

As far as I remember the zip format it's not possible at all. Folders
are created implicitly. The zip format doesn't support empty directories.
Zip files don't actually support folders; it's just that by convention
slashes ('/') are used in the names to represent the folder hierarchy,
eg. "a/b" is taken to mean file "b" in subfolder "a". I've found from
experience that you can represent an empty folder with an empty file
whose name ends with '/'.
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.