|
|
1.1 ! root 1: ! 2: ! 3: tmpnam() General Function tmpnam() ! 4: ! 5: ! 6: ! 7: ! 8: Generate a unique name for a temporary file ! 9: ! 10: #include <stdio.h> ! 11: cchhaarr *ttmmppnnaamm(_n_a_m_e); ! 12: cchhaarr *_n_a_m_e; ! 13: ! 14: tmpnam constructs a unique name for a file. The names returned ! 15: by tmpnam generally are mechanical concatenations of letters, and ! 16: therefore are mostly used to name temporary files, which are ! 17: never seen by the user. Unlike a file created by tmpfile, a file ! 18: named by tmpnam does not automatically disappear when the program ! 19: exits. It must be explicitly removed before the program ends if ! 20: you want it to disappear. ! 21: ! 22: name points to the buffer into which tmpnam writes the name it ! 23: generates. If name is set to NULL, tmpnam writes the name into ! 24: an internal buffer that may be overwritten each time you call ! 25: this function. ! 26: ! 27: tmpnam returns a pointer to the temporary name. Unlike the ! 28: related function tempnam, tmpnam assumes that the temporary file ! 29: will be written into directory /tmp and builds the name accor- ! 30: dingly. ! 31: ! 32: ***** Example ***** ! 33: ! 34: For an example of this function, see execve. ! 35: ! 36: ***** See Also ***** ! 37: ! 38: general functions, mktemp(), STDIO, tempnam() ! 39: ! 40: ***** Notes ***** ! 41: ! 42: If you want the file name to be written into buffer, you should ! 43: allocate at least L_tmpnam bytes of memory for it; L_tmpnam is ! 44: defined in the header stdio.h. ! 45: ! 46: ! 47: ! 48: ! 49: ! 50: ! 51: ! 52: ! 53: ! 54: ! 55: ! 56: ! 57: ! 58: ! 59: ! 60: ! 61: ! 62: ! 63: ! 64: COHERENT Lexicon Page 1 ! 65: ! 66:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.