⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tempnam.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>tempnam</title></head><body bgcolor=white><center><font size=2>The Single UNIX &reg; Specification, Version 2<br>Copyright &copy; 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_009_528">&nbsp;</a>NAME</h4><blockquote>tempnam - create a name for a temporary file</blockquote><h4><a name = "tag_000_009_529">&nbsp;</a>SYNOPSIS</h4><blockquote><pre><code>#include &lt;<a href="stdio.h.html">stdio.h</a>&gt;char *tempnam(const char *<i>dir</i>, const char *<i>pfx</i>);</code></pre></blockquote><h4><a name = "tag_000_009_530">&nbsp;</a>DESCRIPTION</h4><blockquote>The<i>tempnam()</i>function generates a pathname that may be used for a temporary file.<p>The<i>tempnam()</i>function allows the user to control the choice of a directory.  The<i>dir</i>argument points to the name of the directory in which the file is to becreated.  If<i>dir</i>is a null pointeror points to a string which is not a namefor an appropriate directory, the path prefix defined as{P_tmpdir} in the<i><a href="stdio.h.html">&lt;stdio.h&gt;</a></i>header is used.If that directory is not accessible,an implementation-dependent directory may be used.<p>Many applications prefer their temporary files to have certaininitial letter sequences in their names.The<i>pfx</i>argument should be used for this.This argument may be a null pointer or point to a stringof up to five bytes to be used as the beginning of the filename.<p>Some implementations of<i>tempnam()</i>may use<i><a href="tmpnam.html">tmpnam()</a></i>internally.  On such implementations, if called more than {TMP_MAX}times in a single process, the behaviour is implementation-dependent.</blockquote><h4><a name = "tag_000_009_531">&nbsp;</a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>tempnam()</i>allocates space for a string, puts the generated pathname in thatspace and returns a pointer to it.The pointer is suitable for use in a subsequent call to<i><a href="free.html">free()</a></i>.Otherwise it returns a null pointer and sets<i>errno</i>to indicate the error.</blockquote><h4><a name = "tag_000_009_532">&nbsp;</a>ERRORS</h4><blockquote>The<i>tempnam()</i>function will fail if:<dl compact><dt>[ENOMEM]<dd>Insufficient storage space is available.</dl></blockquote><h4><a name = "tag_000_009_533">&nbsp;</a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_009_534">&nbsp;</a>APPLICATION USAGE</h4><blockquote>This function only creates pathnames.It is the application's responsibility to create and remove the files.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_009_535">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_009_536">&nbsp;</a>SEE ALSO</h4><blockquote><i><a href="fopen.html">fopen()</a></i>,<i><a href="free.html">free()</a></i>,<i><a href="open.html">open()</a></i>,<i><a href="tmpfile.html">tmpfile()</a></i>,<i><a href="tmpnam.html">tmpnam()</a></i>,<i><a href="unlink.html">unlink()</a></i>,<i><a href="stdio.h.html">&lt;stdio.h&gt;</a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from Issue 1 of the SVID.</blockquote><hr size=2 noshade><center><font size=2>UNIX &reg; is a registered Trademark of The Open Group.<br>Copyright &copy; 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 + -