Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mktemp(3C) — HP-UX 5.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getpid(2)

getpid(2)

tmpfile(3S)

tmpnam(3S)

MKTEMP(3C)  —  HP-UX

NAME

mktemp − make a unique file name

SYNOPSIS

char ∗mktemp (template)
char ∗template;

DESCRIPTION

Mktemp replaces the contents of the string pointed to by template by a unique file name, and returns the address of template. The string in template should look like a file name with six trailing Xs; mktemp will replace the Xs with a letter and the current process ID.  The letter will be chosen so that the resulting name does not duplicate the name of an existing file.  If there are less than 6 Xs, the letter will be dropped first, and then high order digits of the process ID will be dropped. 

RETURN VALUE

Mktemp returns its argument except when it runs out of letters, in which case the result is a pointer to the empty string "". 

SEE ALSO

getpid(2). 

SEE ALSO

getpid(2), tmpfile(3S), tmpnam(3S). 

BUGS

It is possible to run out of letters. 

Mktemp does not check to see if the file name part of template exceeds the maximum length of a file name. 

Hewlett-Packard Company  —  Version B.1,  April 12, 1993

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026