[Zope] POSKeyError, help, please.

Dieter Maurer dieter@handshake.de
Tue, 25 Mar 2003 20:03:54 +0100

BZ wrote at 2003-3-24 18:03 -0600:
 > ...
 > Questions:
 > - How do you truncate a Data.fs to an offset?

There is a HowTo on Zope.org about repairing corrupted
Data.fs. It tells you how to truncate a file.

It's the "truncate" method of Pythons file objects.

 > - How do I know where the object is that had the problem (will I see it in
 > the Data.fs dump I did?)

The POSKeyError tells you the oid of the missing object (as a string).
The dump of your "Data.fs" lists all object records contained
in the "Data.fs" with their oid in hexform.
Object records are contained in transaction records (starting at "offset").
The last occurrence of the object is where the object has
been written latest. When you truncate at the offset
of the following transaction, you have the state as it was after
the object was written.