[Zope3-dev] Re: IKeyReference for files

Christian Theune ct at gocept.com
Tue Mar 27 19:16:59 EDT 2007


Hi,

Am Mittwoch, den 28.03.2007, 01:12 +0200 schrieb Martijn Faassen:
> Wichert Akkerman wrote:
> > Previously Uwe Oestermeier wrote:
> >> Martijn Faassen <faassen at startifact.com> schreibt:
> >>> Now I'm hoping I'm missing some kind of strategy and perhaps someone 
> >>> will have a luminous idea to make this work without the creation of a 
> >>> separate index. Or if not, at least I can give up looking and just go 
> >>> and write that index. Does anyone have any suggestions?
> >> Hi Martijn,
> >>
> >> I have experimented with the inodes of files, which are a good candidate
> >> for IKeyReferences for files. Using inodes solves the problem that the ids
> >> should remain stable across moves. They are also a good basis for a
> >> detection of moves which happen outside the control of Zope.
> > 
> > Unfortuantely there are filesystems without usable inode numbers (or
> > inodes). You also need to take multiple filesystems into account, which
> > means you need to include the device major and minor number in your key.
> > This leads to another problem: those numbers may not be stable across
> > reboots. 
> 
> Not stable across reboot would be bad. This needs to work minimally 
> under Linux and Windows.
> 
> How does one get to inodes on Linux from Python? Does Windows have an 
> equivalent?

Quick shot on integrating the suggestion from Uwe:

- Reserve an OID from the ZODB storage, maybe create a 'shadow' object
in the ZODB.
- Use a directory that maintains a hard link to the real file with the
oid as its name.

Voila.

Btw: This is a good bit like blob support works in ZODB. ;)

Christian

-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - ct at gocept.com - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20070328/d862d200/attachment.bin


More information about the Zope3-dev mailing list