[Zodb-checkins] CVS: Zope3/src/zodb/storage/file - pack.py:1.3

Jeremy Hylton jeremy at zope.com
Tue Apr 22 19:38:40 EDT 2003


Update of /cvs-repository/Zope3/src/zodb/storage/file
In directory cvs.zope.org:/tmp/cvs-serv32488

Modified Files:
	pack.py 
Log Message:
Use seek-to-end instead of stat.

This appears to be necessary because stat() on Win2k is giving the
wrong answer.  Presumably Win2k doesn't get the bytes to disk because
we don't have an fsync() call on that platform.


=== Zope3/src/zodb/storage/file/pack.py 1.2 => 1.3 ===
--- Zope3/src/zodb/storage/file/pack.py:1.2	Tue Apr 22 11:23:12 2003
+++ Zope3/src/zodb/storage/file/pack.py	Tue Apr 22 18:38:39 2003
@@ -13,7 +13,6 @@
 
 import logging
 import os
-import stat
 
 from zodb.interfaces import ZERO, _fmt_oid
 from zodb.utils import p64, u64
@@ -230,7 +229,9 @@
         self._stop = stop
         self._packt = None
         self.locked = False
-        self.file_end = os.stat(self._file.name)[stat.ST_SIZE]
+        self._file.seek(0, 2)
+        self.file_end = self._file.tell()
+        self._file.seek(0)
         
         self.gc = GC(self._file, self.file_end, self._stop)
 




More information about the Zodb-checkins mailing list