13 Mar
2004
13 Mar
'04
11:21 p.m.
On Fri, 2004-03-12 at 13:49, Edward Pollard wrote:
I need to run a report that is basically "What files are in this directory?"
This directory now lives in the ZODB.
Is there anyway to talk to the ZODB from an external method?
the self parameter to an external method provides a context back to the zodb.. def report(self): files = self.objectIds('File') return files if you meant fs directory than your question is worded poorly import os def report(self, dirname): path = os.path.join( os.environ['INSTANCE_HOME'], 'var', dirname) if not os.path.exist( path ): return None return os.listdir( path ) hth, -kapil