ns_mktemp - Make a unique temporary filename
This command is a wrapper around the mktemp(3) function in the C standard library. This function generates a unique temporary filename from an optional template.
Note that some implementations of mktemp are not safe (creating predictable/only a small number of variations) against attacks and race conditions - please consult your system's man pages if this might be an issue to you. In order to create temp files, the Tcl command file tempfile should be used (introduced in Tcl 8.6), which is safe against race conditions.
This command generates a unique temporary filename using optionally a template as argument, which is a string whose last six characters must be XXXXXX, and returns a new string where those are replaced with random characters such as to make the string a unique filename. It is commonly used to create temporary filenames.
If this command is called without the optional parameter it behaves like
ns_mktemp [ns_config ns/parameters tmpdir]/ns-XXXXXX
% ns_mktemp /tmp/aol-XXXXXX /tmp/aol-rhaGGx