[Zope3-checkins] CVS: ZODB4/src/zodb/storage - file.py:1.8.4.14

Barry Warsaw barry@wooz.org
Wed, 12 Mar 2003 16:43:17 -0500


Update of /cvs-repository/ZODB4/src/zodb/storage
In directory cvs.zope.org:/tmp/cvs-serv30220

Modified Files:
      Tag: opaque-pickles-branch
	file.py 
Log Message:
Resolve conflicts from HEAD merge


=== ZODB4/src/zodb/storage/file.py 1.8.4.13 => 1.8.4.14 ===
--- ZODB4/src/zodb/storage/file.py:1.8.4.13	Wed Mar 12 16:12:00 2003
+++ ZODB4/src/zodb/storage/file.py	Wed Mar 12 16:43:16 2003
@@ -154,8 +154,8 @@
 from zodb.interfaces import _fmt_oid
 from zodb.interfaces import *
 from zodb.timestamp import TimeStamp, newTimeStamp, timeStampFromTime
-from zodb.lockfile import lock_file
-from zodb.utils import p64, u64, cp
+from zodb.lockfile import LockFile
+from zodb.utils import p64, u64, cp, z64
 from zodb.storage.fsindex import fsIndex
 from zodb.storage.interfaces import *
 
@@ -218,13 +218,6 @@
 class FileStorageQuotaError(FileStorageError, StorageSystemError):
     """File storage quota exceeded."""
 
-def DB(file_name, create=0, read_only=0, stop=None, quota=None,
-       pool_size=7, cache_size=400):
-    """Create new object database using FileStorage file_name."""
-    fs = FileStorage(file_name, create, read_only, stop, quota)
-    db = zodb.db.DB(fs, pool_size, cache_size)
-    return db
-
 class FileStorageFormatter:
     """Mixin class that can read and write the low-level format."""
 
@@ -597,17 +590,7 @@
         self._quota = quota
 
     def _lock(self):
-        try:
-            f = open(self._name + '.lock', 'r+')
-        except:
-            f = open(self._name + '.lock', 'w+')
-        lock_file(f)
-        try:
-            f.write(str(os.getpid()))
-            f.flush()
-        except:
-            pass
-        self._lock_file = f # so it stays open
+        self._lock_file = LockFile(self._name + '.lock')
 
     def _initIndex(self, index=None, vindex=None, tindex=None, tvindex=None):
         self._index = index or fsIndex()
@@ -1828,7 +1811,6 @@
         self._file.close()
 
         return opos, index, vindex, tindex, tvindex
-
 
 def _truncate(file, name, pos):
     seek=file.seek