Python zipfile: Zip empty directories.

M

Mark Wondratschek

Hi!
I hope it's a simple question:
How can I pack empty directories? I want to mirror a whole directory
structure in an archive. So I want to zip non-empty AND empty directories.
Any ideas?
Thank you in advance!

Best regards

Mark
 
P

Peter Otten

Mark said:
How can I pack empty directories? I want to mirror a whole directory
structure in an archive. So I want to zip non-empty AND empty directories.
Any ideas?

As far as I remember, the zip format does not support storing empty
directories. But you could put a file with an easily recognizable name in
all empty directories, e.g. __empty__.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top