Re: PdataStreamIterator bug?

Roché Compaan <roche-kb4xc5yObU3kQYj/0HfcvhBnub05S5/[email protected]> Thu, 25 May 2006 15:17:35 +0200
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Organization Upfront Systems
Message-ID <[email protected]>
On Thu, 2006-05-25 at 09:51 -0300, Sidnei da Silva wrote:
> On Thu, May 25, 2006 at 02:43:07PM +0200, Roché Compaan wrote:
> | Hi there
> | 
> | I've been trying to get file streaming to work with FileSystemStorage
> | but it seems that all the good work done elsewhere in Zope or Plone is
> | undone by Archetypes.WebDAVSupport.PdataStreamIterator. The problem is
> | that PdataStreamIterator returns the whole file in the first iteration
> | by calling "str(data)". In the first call to "next", self.data is a
> | Pdata instance and calling str on a Pdata object returns the whole
> | file. 
> | 
> | I'll log this in http://dev.plone.org/archetypes
> 
> Uhm? You must be looking at the wrong version of archetypes. The
> latest doesn't have any str(data).

I've looked at the latest version and I don't quite understand the
rationale behind the implementation. Why is it necessary to read the
whole file into a temporary file, if it can be streamed by iterating
over the Pdata chain. This will keep memory consumption low, and will be
much more responsive from the clients point of view - waiting for N
gigabyte to be written to a tempfile first can take a while.

-- 
Roché Compaan
Upfront Systems                 http://www.upfrontsystems.co.za



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642