[Tutor] Zip-ing files/folders - collecting opinions

Branimir Petrovic BranimirP@cpas.com
Wed Jan 29 13:44:02 2003


> -----Original Message-----
> From: Magnus Lycka [mailto:magnus@thinkware.se]
> Sent: January 29, 2003 12:36 PM
> To: Simon Wittber (Maptek); Branimir Petrovic; tutor@python.org
> Subject: RE: [Tutor] Zip-ing files/folders - collecting opinions
> 
> 
> At 12:32 2003-01-29 +0800, Simon Wittber (Maptek) wrote:
> >It's a small program which zips up a directory structure 
> into an python
> >program. You then run the generated python program to expand 
> the tree.
> 
> Cute!
> 
> >...

> I'm curious to hear how this works with 4 GB files... That
> will be a big string.
> 

This would probably be the longest Python program ever ;-)

There is also minor issue to be fixed, namely this:

outfile = file("temp." + outfilename, "w")

will not work as is on Windows platform since 'outfilename' will
contain no-no characters (colon after vol. name like C:), but is 
trivial to fix.

I am wary of reading humungous 4 GB++ files in RAM, all in one
large 'slurp', but the idea of bonding Python script with data
is brilliant. No way to misplace re-assembling code, all needed
is there - all the time. Cookbook worthy recipe!

Branimir