[Zope] total size of files in a folder

Cornelis J. de Brabander brabander@fsw.LeidenUniv.nl
Wed, 27 Feb 2002 13:09:49 +0100


Your total_size is initialized for each element of your objectValues list.
I would use "REQUEST.set('total_size'=total_size+size)"
cheers

Cornelis J. de Brabander
==========================================
Department of Education, Leiden University
P.O.Box 9555, NL-2300 RB Leiden
+31 71 527 3422/3401
brabander@fsw.leidenuniv.nl
==========================================

> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Marcus Bergmann
> Sent: woensdag 27 februari 2002 12:58
> To: zope@zope.org
> Subject: [Zope] total size of files in a folder
>
>
> Hi,
>
> I want to get the total size of a folder. I do a loop over all files in
> the folder, but it gives me only the size of the last file in the
> folder:
>
> <dtml-let total_size="0">
>  <dtml-in "Files.objectValues()">	#Files is the name of my folder
>   <dtml-let total_size="total_size+size">
>    <dtml-if sequence-end>
>     <dtml-var total_size>
>    </dtml-if>
>   </dtml-let>
>  </dtml-in>
> </dtml-let>
>
> Alternatively, is there simply a variable I can lookup to get the size
> of the folder?
>
> Thank you,
> Marcus
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>