TMPFILE - create a temporary file.

(ANSI Standard)


#include <stdio.h>
fp = tmpfile();


FILE *fp;
is a file pointer for the temporary file.


"tmpfile" uses "tmpnam" to create a name for a temporary file, then opens the file with "fopen" using the "wb+t" (update) option. If the file cannot be opened for some reason, "tmpfile" returns a NULL pointer.

A file created with "tmpfile" is automatically removed when the file is closed or when the program terminates.

The files created by "tmpfile" will be GCOS8 temporary files.

See Also:

expl nsc lib tmpnam

expl nsc lib fopen

expl nsc lib mktemp

Copyright © 2000, Thinkage Ltd.