# Synopsis

char *ugn_TempFile(void)

# Purpose

Generate temporary file name.

# Description

This function will generate a temporary file name based on the tmpnam function or an internal name if the PDELIB_TMP environment variable is set. The value returned is a pointer to a static area which will be destroyed on the next call. The name returned will include the value of PDELIB_TMP followed by the temporary file name. If the value in PDELIB_TMP does not end in a directory character, one will be added before the temporary file name.

The internal name that is generated consists of the following format for all platforms:

.RS 3 Txxxxxyy.zzz .RE

Where xxxxx is a five digit, 0 padded hex number consisting of the process ID as returned by ugn_GetPID. The yy portion is a two digit hex number that begins at 0 and is incremented once each time this function is called. The zzz portion is a 3 digit hex number starting at 0 which is incremented once each 256 calls to this function.

Where yyyyy is a five digit hex number that is incremented once each time this function is called.

Note that this function does not verify that a file with the given name does not already exist.

# Return

Temporary file name or NULL if error