📄 tmpfile.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>tmpfile</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_082"> </a>NAME</h4><blockquote>tmpfile - create a temporary file</blockquote><h4><a name = "tag_000_010_083"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="stdio.h.html">stdio.h</a>>FILE *tmpfile(void);</code></pre></blockquote><h4><a name = "tag_000_010_084"> </a>DESCRIPTION</h4><blockquote>The<i>tmpfile()</i>function creates a temporary file and opens a corresponding stream. The filewill automatically be deleted when all references to the file are closed. Thefile is opened as in<i><a href="fopen.html">fopen()</a></i>for update (w+).<p>The largest value that can be represented correctly in an object of type<b>off_t</b>will be established as the offset maximum in the open file description.<p>If the process is killed in the period between file creation and unlinking, a permanent file may be left behind.<p>An error message may be written to standard error if the stream cannot be opened.</blockquote><h4><a name = "tag_000_010_085"> </a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>tmpfile()</i>returns a pointer to the stream of the file that is created.Otherwise, it returns anull pointer and sets<i>errno</i>to indicate the error.</blockquote><h4><a name = "tag_000_010_086"> </a>ERRORS</h4><blockquote>The<i>tmpfile()</i>function will fail if:<dl compact><dt>[EINTR]<dd>A signal was caught during<i>tmpfile()</i>.<dt>[EMFILE]<dd>{OPEN_MAX} file descriptors are currently open in the calling process.<dt>[ENFILE]<dd>The maximum allowable number of files is currently open in thesystem.<dt>[ENOSPC]<dd>The directory or file system which would contain thenew file cannot be expanded.<dt>[EOVERFLOW]<dd>The file is a regular file and the size of the file cannot berepresented correctly in an object of type<b>off_t</b>.</dl><p>The<i>tmpfile()</i>function may fail if:<dl compact><dt>[EMFILE]<dd>{FOPEN_MAX} streams are currently open in the calling process.<dt>[ENOMEM]<dd>Insufficient storage space is available.</dl></blockquote><h4><a name = "tag_000_010_087"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_010_088"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_010_089"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_010_090"> </a>SEE ALSO</h4><blockquote><i><a href="fopen.html">fopen()</a></i>,<i><a href="tmpnam.html">tmpnam()</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 + -