On 02/08/2013 12:59am, Victor Stinner wrote:
On Windows, a file cannot be removed if at least one process opened
it. If you create a temporary file, run a program, and delete the
temporary file: the deletion fails if the program inherited the file
and the program is not done before the deletion. Is this correct?

It depends whether the handles use FILE_SHARE_DELETE. The Python module tempfile uses the O_TEMPORARY flag which implies FILE_SHARE_DELETE. This means that the file *can* be deleted/moved while there are open handles. Annoyingly the folder containing that file still cannot be deleted while there are open handles.

--
Richard

_______________________________________________
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