clinuxtemporary-filesmktemp

create a temporary file with unpredictable name


When we create temporary files using tmpfile, in most cases we cannot easily predict the name. Coverity scan also complains about its vulnerability. So is there any function to create a temporary file which cannot be guessed easily?


Solution

  • If you using Linux, then mkstemp

    Or use tmpnam