Weak replacement for the Python’s tempfile.TemporaryFile.
This function is a replacment for tempfile.NamedTemporaryFile() but will work also with Windows 7/Vista’s UAC.
Parameters: |
---|
Warning
Caller is responsible for deleting the file when done with it.
Example
>>> ntf = NamedTemporaryFile()
>>> ntf._fileobj
<open file '<fdopen>', mode 'w+b' at 0x...>
>>> ntf._fileobj.close()
>>> os.remove(ntf.name)
>>> filename = NamedTemporaryFile().name
>>> fh = open(filename, 'wb')
>>> fh.write("test")
>>> fh.close()
>>> os.remove(filename)