create a temporary file
cc ... -lc
FILE *tmpfile ()
The tmpfile function
creates a temporary file
and returns the corresponding FILE pointer.
If the file cannot be opened, a NULL
pointer is returned.
The file is automatically deleted when all references to
the file have been closed.
The file is opened for update (w+).
The tmpfile routine fails if:
[FOPEN_MAX] streams are currently open in the calling process.
The system file table is full.
The directory of file system which would contain the new file
cannot be expanded.
The tmpfile routine may fail if:
Search permission is denied on a component of the path prefix of
the file to be created, or write permission is denied for the
parent directory of the file to be created.
A signal was caught during the tmpfile function.
Insufficient storage space is available.
A component of the path prefix of the file to be created is not a
The file to be created would reside on a read-only file system.
The stream refers to a file that has been unlinked. If the
process is killed in the period between file creation and
unlinking, a permanent file may be left behind.
tmpfile is conformant with:
X/Open Portability Guide, Issue 3, 1989
ANSI X3.159-1989 Programming Language -- C
IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1)
NIST FIPS 151-1
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003