fileName = Files.temporaryFileName();
Return arbitrary name of a file that does not exist and is in a directory where access rights allow to write to this file (useful for temporary output of files).
The created temporary file is not automatically deleted when closed, but needs to be explicitly deleted, e.g. by removeFile(fileName).
Warning: The underlying C implementation of ModelicaInternal_temporaryFileName calls the standard C function tmpnam, which has a race condition security problem in the case another process creates a file with the same fileName just after tmpnam generated the full path name.
fileName = Files.temporaryFileName(); -> fileName is the absolute path name of the temporary file Streams.print(String(System.getPid()), fileName); -> Create the temporary file Warning: Possible race condition on file access Files.removeFile(fileName); -> Explicitly delete the temporary file (after use)
function temporaryFileName extends Modelica.Icons.Function; output String fileName "Full path name of temporary file"; end temporaryFileName;