60 lines · 1.1 KB · Text
RawDownload
.TH TMPFILE 2.SH NAMEtmpfile, tmpnam \- Stdio temporary files.SH SYNOPSIS.B #include <u.h>.br.B #include <stdio.h>.PP.ta \w'\fLFILE 'u.BFILE	*tmpfile(void).PP.Bchar	*tmpnam(char *s).SH DESCRIPTION.I Tmpfilecreates a temporary file that will automaticallybe removed when the file is closed or the program exits.The return value is a Stdio.B FILE*opened in update mode (see.IR fopen (2))..PP.I Tmpnamgenerates a string that is a valid file name and that is notthe same as the name of an existing file.If.I sis zero, it returns a pointer to a string which may be overwritten bysubsequent calls to.IR tmpnam .If.I sis non-zero, it should point to an array of at least.B L_tmpnam(defined in.BR <stdio.h> )characters, and the answer will be copied there..SH FILES.TF /tmp/tf000000000000.TP.B /tmp/tf000000000000template for.I tmpfilefile names..TP.B /tmp/tn000000000000template for.I tmpnamfile names..SH SOURCE.B /sys/src/libstdio.SH BUGSThe files created by.I tmpfileare not removed until.IR exits (2)is executed; in particular, they are not removed on.I fcloseor if the program terminates abnormally.