using NamedTemporaryFile on windows

Lee Harr lee at example.com
Wed Dec 28 22:17:15 EST 2005


Is there any other reason to use a named tempfile other than
to be able to open it again? I am trying to understand this
section of the documentation regarding NamedTemporaryFile:


"""
Whether the name can be used to open the file a second time, while the named temporary file 
is still open, varies across platforms (it can be so used on Unix; it cannot on Windows NT 
or later)
"""


>From looking through the code, the NamedTemporaryFile will be
deleted as soon as it is closed.

So... if I can't open it again why does it need a name?

Is there a way on windows to make a tempfile that I can open again?

Maybe what I need is just mkstemp, since that also returns a name?
If so, what is the point of NamedTemporaryFile?



More information about the Python-list mailing list