Am Mittwoch, den 07.03.2007, 21:12 +0100 schrieb Uwe Oestermeier:
> Christian Theune <[EMAIL PROTECTED]> 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.

Nope. It won't disappear if you link it again. And the link(src, dst)
does move it to a 'save' location ;)

Christian

-- 
gocept gmbh & co. kg - forsterstra├če 29 - 06112 halle/saale - germany
www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to