[Zope3-dev] Proposal for optimized Blob handling

Uwe Oestermeier u.oestermeier at iwm-kmrc.de
Wed Mar 7 15:12:53 EST 2007


Christian Theune <ct at gocept.com> schreibt:
>This is how the dance looks like to do the link():
>
> >>> import tempfile, os
> >>> d = tempfile.NamedTemporaryFile()
> >>> os.path.exists(d.name)
> True
> >>> d.write('Test')
> >>> os.path.exists('/tmp/asdf')
> False
> >>> os.link(d.name, '/tmp/asdf')
> >>> d.close()
> >>> os.path.exists(d.name)
> False
> >>> os.path.exists('/tmp/asdf')
> True
> >>> open('/tmp/asdf').read()
> 'Test'

Yeah, but as Dieter said the temp file should be better renamed or moved
to a save location.
It is likely that a temp file disappears.

Uwe

________________________________________________________________
Dr. Uwe Oestermeier
Institut für Wissensmedien
Knowledge Media Research Center
Konrad-Adenauer-Str. 40
D-72072 Tuebingen
Germany
u.oestermeier at iwm-kmrc.de
Tel. +49 7071 979-208
Fax +49 7071 979-100





More information about the Zope3-dev mailing list