Standards / Extensions | C or C++ | Dependencies |
---|---|---|
XPG4.2 |
both | POSIX(ON) |
#define _XOPEN_SOURCE_EXTENDED 1
#include <stdlib.h>
char *mktemp(char *template);
The mktemp() function replaces the contents of the string pointed by template by a unique file name and returns template. The application must initialize template to be a file name with six trailing 'X's; mktemp() replaces each 'X' with a single-byte character from the portable file name character set.
This function is supported only in a POSIX program.
If successful, mktemp() returns a pointer to template.
If a unique name cannot be created, mktemp() sets template to a NULL string.
There are no errno values defined.