RosettaCodeData/Task/Secure-temporary-file/Python/secure-temporary-file-2.py

6 lines
103 B
Python
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
fd, path = tempfile.mkstemp()
try:
# use the path or the file descriptor
finally:
os.close(fd)