I am working with some legacy code that goes around a file name. I would like to create a temporary file and give the legacy code the name of the file that will be opened later using the legacy functions. tmpnamis unsafe due to the race between getting the name and creating the file. mkdirdoes not migrate to Windows and does not allow me to have a file name. How to create a temporary file safely, portable and with file name preservation?
source
share