I want to count the number of files within a folder (the folder does not have subfolders), so I can say "This folder countains ## pictures". How can that be done?
Hi, <dtml-var "_.len(foldername.objectValues())"> or in an dtml-method in that folder (or aquired into that folder) <dtml-var "_.len(objectValues())"> cheers, oliver
objectIds is much faster since it just a property of the container, where as objectValues actually goes and gets each object inside the container. You wont notice it until you get large numbers of objects though... <dtml-var "_.len(objectIds())"> Cheers. -- Andy McKay. ----- Original Message ----- From: "Oliver Bleutgen" <myzope@gmx.net> To: <zope@zope.org> Sent: Tuesday, September 18, 2001 6:32 AM Subject: Re: [Zope] How to count files in a folder?
I want to count the number of files within a folder (the folder does not have subfolders), so I can say "This folder countains ## pictures". How can that be done?
Hi,
<dtml-var "_.len(foldername.objectValues())">
or in an dtml-method in that folder (or aquired into that folder)
<dtml-var "_.len(objectValues())">
cheers, oliver
_______________________________________________ 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 )
participants (2)
-
Andy McKay -
Oliver Bleutgen