📄 tmpnam.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>tmpnam</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_010_091"> </a>NAME</h4><blockquote>tmpnam - create a name for a temporary file</blockquote><h4><a name = "tag_000_010_092"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="stdio.h.html">stdio.h</a>>char *tmpnam(char *<i>s</i>);</code></pre></blockquote><h4><a name = "tag_000_010_093"> </a>DESCRIPTION</h4><blockquote>The<i>tmpnam()</i>function generates a string that is a valid filename and that isnot the same as the name of an existing file.<p>The<i>tmpnam()</i>function generates a different string each time it is called from the sameprocess, up to {TMP_MAX} times. If it is called more than {TMP_MAX} times,the behaviour is implementation-dependent.<p>The implementation will behave as if no function defined in this document calls<i>tmpnam()</i>.<p>If the application uses any of the interfaces guaranteed to beavailable if either _POSIX_THREAD_SAFE_FUNCTIONS or _POSIX_THREADS isdefined, the<i>tmpnam()</i>function must be called with a non-NULL parameter.</blockquote><h4><a name = "tag_000_010_094"> </a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>tmpnam()</i>returns a pointer to a string.<p>If the argument<i>s</i>is a null pointer,<i>tmpnam()</i>leaves its result in an internal static object and returns a pointer to thatobject. Subsequent calls to<i>tmpnam()</i>may modify the same object. If the argument<i>s</i>is not a null pointer, it is presumed to point to an array of atleast {L_tmpnam}<b>char</b>s;<i>tmpnam()</i>writes its result in that array and returns the argument as its value.</blockquote><h4><a name = "tag_000_010_095"> </a>ERRORS</h4><blockquote>No errors are defined.</blockquote><h4><a name = "tag_000_010_096"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_010_097"> </a>APPLICATION USAGE</h4><blockquote>This function only creates filenames. It is the application's responsibilityto create and remove the files.<p>Between the time a pathname is created and the file is opened, itis possible for some other process to create a file with the same name.Applications may find<i><a href="tmpfile.html">tmpfile()</a></i>more useful.</blockquote><h4><a name = "tag_000_010_098"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_010_099"> </a>SEE ALSO</h4><blockquote><i><a href="fopen.html">fopen()</a></i>,<i><a href="open.html">open()</a></i>,<i><a href="tempnam.html">tempnam()</a></i>,<i><a href="tmpfile.html">tmpfile()</a></i>,<i><a href="unlink.html">unlink()</a></i>,<i><a href="stdio.h.html"><stdio.h></a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from Issue 1 of the SVID.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -