Connecting Tech Pros Worldwide Forums | Help | Site Map

Re: Writing Empty folders into ZipFile

Christian Heimes
Guest
 
Posts: n/a
#1: Jun 27 '08
otaeris@o2.pl schrieb:
Quote:
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


MRAB
Guest
 
Posts: n/a
#2: Jun 27 '08

re: Re: Writing Empty folders into ZipFile


On Jun 3, 10:03 am, Christian Heimes <li...@cheimes.dewrote:
Quote:
otae...@o2.pl schrieb:
>
Quote:
Hello.
>
Quote:
I'm having situation writing folders structure into
a zip file. Folders contain no files.
>
Quote:
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 '/'.
Closed Thread