mktemp

Creates a unique file name from a template.

Format

#include  <stdlib.h>

char *mktemp  (char *template);
Function Variants This function also has variants named _mktemp32 and _mktemp64 for use with 32-bit and 64-bit pointer sizes, respectively. See Section 1.8 for more information on using pointer-size-specific functions.

Argument

template
A pointer to a buffer containing a user-defined template. You supply the template in the form, namXXXXXX. The six trailing Xs are replaced by a unique series of characters. You may supply the first three characters. Because the template argument is overwritten, do not specify a string literal (const object).

Description

The use of mktemp is not recommended for new applications. See the tmpnam and mkstemp functions for the preferable alternatives.

Return Value
A pointer to the template, with the template modified to contain the created file name. If this value is a pointer to a null string, it indicates that a unique file name cannot be created. 


Previous Page | Next Page | Table of Contents | Index