Zvezdan Petkovic wrote:
> Of course, the above are C functions.  I don't think that Python
> programming is immune from such security considerations either.

The tempfile module exposes the same functionality (and uses mkstemp()
to create its filenames). It has also had features added over the years
to prevent automatic deletion of the temporary files, precisely so you
*can* grab them and rename them afterwards.

It actually wouldn't be a bad place to put a "create a temporary file
and rename it to <name> when closing it" helper class. Such a utility
could also include a way to request "fsync() before rename" behaviour
(off by default of course).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to