Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python zipfile: Zip empty directories.

Reply
Thread Tools

Python zipfile: Zip empty directories.

 
 
Mark Wondratschek
Guest
Posts: n/a
 
      08-29-2003
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


 
Reply With Quote
 
 
 
 
Peter Otten
Guest
Posts: n/a
 
      08-29-2003
Mark Wondratschek wrote:

> 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
 
Reply With Quote
 
 
 
 
Mark Wondratschek
Guest
Posts: n/a
 
      09-01-2003
ThanX a lot Peter!

"Peter Otten" <(E-Mail Removed)> wrote in message
news:biqg9h$9g8$01$(E-Mail Removed)-online.com...
> Mark Wondratschek wrote:
>
> > but this must be supported by the zip format
> > ('cause winzip etc. does it this way). The empty-file idea was one of my
> > reflections, too. But I'm sure there must be better ways...

>
> See what I've found (did not test it myself) googling for
> zip empty directory:
>
> http://mail.python.org/pipermail/pyt...ne/170517.html
>
> Peter



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
empty set and empty dict for Python 3 Yingjie Lan Python 1 07-15-2010 12:49 PM
Possibility to add a zip-file to a new zip-file with "add to zip" (right-click) ?? erikkie@casema.nl Computer Support 4 06-26-2006 12:18 AM
java.util.zip.ZipException: error in opening zip file HARI OM Java 0 05-03-2005 05:02 PM
java.util.zip.ZipException: error in opening zip file hari_om@hotmail.com Java 0 05-03-2005 04:47 PM
java.util.zip - problem opening some legitimite me zip files Alex Hunsley Java 1 09-16-2004 02:06 PM



Advertisments