[ZODB-Dev] how can I get the size of ZODB.Blob object ?

Andreas Jung lists at zopyx.com
Tue Jul 7 10:47:16 EDT 2009


How about seek()ing to the end of the blob and then using tell() for getting
the position?

Andreas

On 07.07.09 15:11, KLEIN Stéphane wrote:
> Hi,
>
> I've take cognizance of ZODB.Blob. I think it's great tools.
>
> Know, I've one question : how can I get the size (in octet) of Blob 
> object ?
>
>   
>>>> f = myblob.open("r")
>>>> size = len(f.read())
>>>> print size
>>>>         
> This code isn't efficient. What is the good method ?
>
> Thanks for your help,
> Stephane
>
> _______________________________________________
> For more information about ZODB, see the ZODB Wiki:
> http://www.zope.org/Wikis/ZODB/
>
> ZODB-Dev mailing list  -  ZODB-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zodb-dev
>   


-- 
ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: info at zopyx.com - Phone +49 - 7071 - 793376
Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535
Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK
------------------------------------------------------------------------
E-Publishing, Python, Zope & Plone development, Consulting


-------------- next part --------------
A non-text attachment was scrubbed...
Name: lists.vcf
Type: text/x-vcard
Size: 316 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zodb-dev/attachments/20090707/18daf7b2/attachment.vcf 


More information about the ZODB-Dev mailing list