Seb, Many thanks... I'm not that far from the result (got a size of 45769528967274 bytes in the Example folder of Zope 2.5.0 ;-) Arithmetic overflow error in bigger folders... Gonna check what's wrong ... Cheers --Gilles ----- Original Message ----- From: "seb bacon" <seb@jamkit.com> To: "Gilles Lenfant" <glenfant@bigfoot.com> Cc: <zope@zope.org> Sent: Friday, February 01, 2002 5:05 PM Subject: Re: [Zope] Size of a Folder
On Fri, 2002-02-01 at 15:56, Gilles Lenfant wrote:
Hi,
Is there a way to know the size of a ZODB Folder ? Something like "du somefolder" in UNIX ?
No, but it would be easy enough to write a python script which did it. This is a bit of a lazy way of doing it, and I've not tested it beyond a quick go, but try something like:
##parameters=folder=None, size=0 ##title=folder_size
if not folder: folder = context
for item in folder.objectValues(): if hasattr(item, 'get_size'): size = size + item.get_size() size = size + item.folder_size(size=size)
return size
Thanks in advance !
--Gilles