Guardian C Library Calls Reference Manual
Reference to Library Calls
Guardian TNS C Library Calls Reference Manual—128833 3-223
tmpnam
tmpfile
The tmpfile function creates a temporary C binary file, opening it for ANSI I/O and
binary update access (“wb+”). This temporary file is automatically removed when it is
closed or when the program terminates.
Return Value
points to the FILE structure denoting the opened temporary file if the operation is
successful; otherwise, tmpfile returns the pointer value NULL.
tmpnam
The tmpnam function produces a valid file name that differs from all file names in the
default volume and subvolume; consequently, you can use this name to create a new file.
name_buf
is either the pointer value NULL or a pointer to an array of char that can
accommodate at least L_tmpnam (defined in <stdioh>) characters. If name_buf is
NULL, tmpnam stores the file name it generates in an internal buffer; otherwise,
tmpnam stores the file name in the buffer starting at *name_buf.
Return Value
points to the buffer containing the generated file name if the operation is successful;
otherwise, tmpnam returns the pointer value NULL.
Usage Guidelines
•
The tmpnam function will successfully produce a unique file name at least
TMP_MAX (defined in <stdioh>) times.
#include <stdioh>
FILE *tmpfile(void);
#include <stdioh>
char *tmpnam(char *name_buf);