[Zope-Checkins] CVS: ZODB3/ZODB - FileStorage.py:1.98.2.11

Jeremy Hylton jeremy at zope.com
Thu Sep 11 13:22:11 EDT 2003


Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv8570/ZODB

Modified Files:
      Tag: Zope-2_6-branch
	FileStorage.py 
Log Message:
Sync with changes mode on the soon-to-be-defunct ZODB3-3_1-branch.


=== ZODB3/ZODB/FileStorage.py 1.98.2.10 => 1.98.2.11 ===
--- ZODB3/ZODB/FileStorage.py:1.98.2.10	Tue May 20 08:58:21 2003
+++ ZODB3/ZODB/FileStorage.py	Thu Sep 11 12:21:40 2003
@@ -1557,6 +1557,11 @@
             raise CorruptedDataError, h
         return h[8:]
 
+    def cleanup(self):
+        """Remove all files created by this storage."""
+        cleanup(self._file_name)
+
+
 def shift_transactions_forward(index, vindex, tindex, file, pos, opos):
     """Copy transactions forward in the data file
 
@@ -2277,3 +2282,13 @@
              'description': d}
         d.update(e)
         return d
+
+
+def cleanup(filename):
+    """Remove all FileStorage related files."""
+    for ext in '', '.old', '.tmp', '.lock', '.index', '.pack':
+        try:
+            os.remove(filename + ext)
+        except OSError, e:
+            if e.errno != errno.ENOENT:
+                raise




More information about the Zope-Checkins mailing list