bsd man page for mkstemp

Query: mkstemp

OS: bsd

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

MKTEMP(3)						     Library Functions Manual							 MKTEMP(3)

NAME
mktemp - make a unique file name
SYNOPSIS
char *mktemp(template) char *template; mkstemp(template) char *template;
DESCRIPTION
Mktemp creates a unique file name and returns the address of the template. The template should contain a file name with trailing X's, nor- mally something like /tmp/tempXXXXXX. The X's are replaced by the current process number and/or a unique letter combination. Mkstemp makes the same replacement to the template but opens the template file and returns a file descriptor open for reading and writing. Mkstemp avoids the race between testing whether the file exists and opening it for use. The number of file name combinations mktemp and mkstemp will try depends on the number of X's placed on the end of the template; six X's will result in them trying roughly 26 ** 6 combinations.
SEE ALSO
access(2), getpid(2), open(2)
DIAGNOSTICS
Mktemp returns NULL on failure, mkstemp returns -1 if no suitable file could be created. 7th Edition April 10, 1987 MKTEMP(3)
Related Man Pages
mkdtemp(3c) - opensolaris
mktemp(3c) - opensolaris
mktemp(3) - linux
mkstemp(3) - osf1
mkstemp(3) - osx
Similar Topics in the Unix Linux Community
PROBLEM: RSYNC and no user password "secrets"
rsync not working
/usr/bin/ld: cannot find -lpam
C fdopen with and without -ansi
NTP synchronised problem in our Centos 7.6 node