[mod_python] I need to create a Zip file on the fly and write itto the stream without any temp files or in memory file creation?

Graham Dumpleton grahamd at dscpl.com.au
Mon Mar 6 21:02:43 EST 2006


Deron Meranda wrote ..
> On 3/6/06, jarrod roberson <jarrod.roberson at gmail.com> wrote:
> (BTW, Graham, using the tell() file method means that it is not
> streamable ... e.g., not suitable for very large archives.  Because it
> has to "render" the whole archive, either in memory or on disk.)

I understood that and said as much.

Presuming my memory is correct, where I was coming from was that
towards the end of the discussion of ZipFile the previous time, some
one suggested to use "req" instead of an instance of "StringIO". If
they followed that advice it would indeed fail as "req" doesn't have 
a tell() method, nor seek() etc. Thus, wanted to clarify how they were
attempting to use ZipFile and at least make sure they were using it
in a reasonable way, ignoring the issue for the moment of whether it
could be streamed or not to begin with.

FWIW, just because mod_dav is taking over the bulk of the response
handling, can't see why specific URLs couldn't be intercepted and
made to fire off his existing Java implementation. He hasn't explained
the relationship between URL namespace managed by mod_dav and
the Java stuff to be able to explore that avenue though.

Graham


More information about the Mod_python mailing list