MKTEMP(3) — SUBROUTINES
NAME
mktemp − make a unique file name
SYNOPSIS
char ∗mktemp(template)
char ∗template;
DESCRIPTION
Mktemp replaces template by a unique file name, and returns the address of the template. The template should look like a file name with six trailing X’s, which will be replaced with the current process id and a unique letter.
Notes:
•Mktemp actually changes the template string which you pass, this means that you cannot use the same template string more than once — you need a fresh template for every unique file you want to open.
•When mktemp is creating a new unique filename it checks for the prior existence of a file with that name. This means that if you are creating more than one unique filename, it is bad practice to use the same root template for multiple invocations of mktemp.
SEE ALSO
Sun Release 1.1 — Last change: 6 January 1984