tmpfile(3S)
tmpfile - create a temporary file
As shipped in IRIX 6.5.5. Unchanged since IRIX 6.5.
NAME tmpfile - create a temporary file SYNOPSIS #include <stdio.h> FILE *tmpfile (void); DESCRIPTION tmpfile creates a temporary file, and returns a corresponding FILE pointer. The file is created on the temporary directory indicated by the string P_tmpdir in <stdio.h>. If the file cannot be opened, a NULL pointer is returned. Upon return from tmpfile, you may print an error message using perror(3C), to determine the reason for the failure. A success call to tmpfile will create a temporary file just long enough to obtain the FILE pointer, then delete the file with unlink(2), and finally return the FILE pointer to the calling process. Thus, the only means of accessing the temporary file is though the FILE pointer. The file is opened for update ("w+"). Although the name of the temporary file is generated similarly to those produced by tmpnam(3S), tmpfile uses its own algorithm to generate filenames similar to, but unique from, those generated by tmpnam. This allocates the entire space of tmpnam-generated names to applications code. (See tmpnam(3S) for more information.) SEE ALSO creat(2), unlink(2), fopen(3S), mktemp(3C), perror(3C), stdio(3S), tmpnam(3S).