Programming Guide


Creates a unique file name

char *sm_tmpnam(void)



sm_tmpnam is an extension of the ANSI function tmpnam(); it returns a name that is unique among other file names.

In Windows, the TMP environment variable will be used to set the temporary file's directory. If TMP is not set but if the environment variable TEMP is set, it will be used. Otherwise, the \ (root directory) on the current disk will be used.

In Linux, if the TMPDIR environment variable is set, it will be used as the trmporary file's directory. In UNIX and when TMPDIR is not set in Linux, P_tmpdir from the stdio.h file will be used. If P_tmpdir is not defined, /tmp will be used.

The default report service unload handler uses this function to generate a temporary file name on the client; it then moves a server-generated metafile to that file name. See "Handling Client Output" on page 9-26 in the Reports Manual for this code.