Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mktemp(3) — SunOS 3.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getpid(2)

MKTEMP(3)  —  C LIBRARY FUNCTIONS

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

getpid(2)

Sun Release 3.0β  —  Last change: 6 January 1984

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