(Compatible with UNIX System V C)
char *mktemp(); s = mktemp( template );
"mktemp" modifies the string "template" to form a unique string and returns a pointer to "template". The last contiguous series of upper case 'X's will be replaced by other letters. This will form an identifier guaranteed to be unique to the current program (provided enough 'X's are specified).
A frequent use of this function is to generate temporary file names. In any case, the template string must conform to any syntactic requirements of whatever will use the unique string. For example, the template
generates a temporary file name that works in TSS, while
will generate a temporary file name that works in both batch and TSS.
"mktemp" is provided for compatibility with UNIX. New programs should use the ANSI standard "tmpnam".
The unique string is generated by calling _unique, so its uniqueness is limited by the uniqueness of the number returned by _unique.
expl nsc lib tmpnam
expl nsc lib _unique
Copyright © 1996, Thinkage Ltd.