[Zope] how to delete all entries in a FileStorage

Chris McDonough chrism@zope.com
Thu, 8 Aug 2002 17:10:21 -0400


"rm -rf Data.fs" typically does the trick. ;-)

Within Zope in Python code, however, you'd want to do something like
this (where self is an object that has an acquisition context that
allows you to call "getPhysicalRoot" on it to get the root Zope
object):

root = self.getPhysicalRoot()
for id in root.objectIds():
   try:
      root._delObject(id)
   except:
      print "Couldn't delete %s" % id


----- Original Message -----
From: "Matthew T. Bell" <mbell@cs.pitt.edu>
To: <zope@zope.org>
Sent: Thursday, August 08, 2002 5:05 PM
Subject: [Zope] how to delete all entries in a FileStorage


> Hi,
>
> Does anyone know how to delete all the objects in a ZODB
FileStorage
> database?
>
> Thanks,
> Matt
>
> --------------------------------------
> Nu sculon herigean heovonrices Weard
> Meotodes mighte ond His modgethanc
>
> Now we must praise the Kingdom of Heaven's Sovereign,
> The Measurer's power and his completed design
> --First two lines, Caedmon's Hymn
> ---------------------------------------
>
>
> _______________________________________________
> 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 )
>