Christian Theune <[EMAIL PROTECTED]> schreibt:
>Nope this is not the correct simulation. Who except your application
>knows about /tmp/asdf? You have to simulate deleting and then
>you'll see that /tmp/asdf does not disappear.

Ok, but what Dieter means is that the tmp dir as a whole is emptied from
time to time.
I see your point that closing a temp file removes it whereas the link
still works,
but that does not solve the problem that system administrators may sweep
things out.
The following solution avoids this problem:

>>> os.mkdir('/Users/uo/blobs')
>>> d = tempfile.NamedTemporaryFile()
>>> d.write('Test')
>>> d.flush()
>>> os.rename(, '/Users/uo/blobs/asdf')
>>> open('/Users/uo/blobs/asdf').read()
>>> os.path.exists('/tmp/asdf')


Dr. Uwe Oestermeier
Institut für Wissensmedien
Knowledge Media Research Center
Konrad-Adenauer-Str. 40
D-72072 Tuebingen
Tel. +49 7071 979-208
Fax +49 7071 979-100

Zope3-dev mailing list

Reply via email to