[Zope3-dev] Proposal for optimized Blob handling

Sidnei da Silva sidnei at enfoldsystems.com
Wed Mar 7 23:30:23 EST 2007


On 3/7/07, Christian Theune <ct at gocept.com> wrote:
> I propose to create a small subclass to override the `make_file` method
> to use `NamedTemporaryFile` instead of `TemporaryFile` to allow the file
> being accessible from a filename so I can apply a `link` operation.
>
> Notice: The FieldStorage explicitly provides the `make_file` method to
> allow overriding in this sense.

Since you're proposing to replace TemporaryFile anyway, and your
'os.link()' proposal requires that both the file and the hard link are
on the same 'drive' or 'partition' or whatever, why not create the
temporary file on a temp directory that is close (hopefully a sibling)
of the final destination blob directory, then you can be sure that
'os.link()' will work and will be 'O(1)' without any extra effort.

Is there any reason not to do that?

-- 
Sidnei da Silva
Enfold Systems                http://enfoldsystems.com
Fax +1 832 201 8856     Office +1 713 942 2377 Ext 214


More information about the Zope3-dev mailing list