[Zope3-dev] Re: IKeyReference for files
Martijn Faassen
faassen at startifact.com
Tue Mar 27 19:07:59 EDT 2007
Jegenye 2001 Bt (Miklós Prisznyák) wrote:
> 2007/3/27, Martijn Faassen <faassen at startifact.com>:
>> Hi there,
>>
>> I'm currently trying to think through how to implement IKeyReference for
>> files on the filesystem. The end goal is to be able to use the intids
>> service on these files, so that they can be cataloged.
>>
>> The simplistic approach to implement key references for files is simply
>> to use the filesystem path as key reference: the path is easy to
>> determine, and it's easy to resolve back to the file.
>>
>> Unfortunately this doesn't work in the case where the files can be moved
>> on the filesystem.
>
> Is it too expensive to compute a hash from the file contents and the
> file attributes?
I'm not sure how this would help. You'd still need to be able to resolve
a key reference to an actual file. A hash would only help finding it
again if you had an index with the hashes in there, or a full scan. It
would also break when you change the file contents.
Regards,
Martijn
More information about the Zope3-dev
mailing list