1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" References consulted:
24 .\" Linux libc source code
25 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
27 .\" Modified Sat Jul 24 17:46:57 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified 2001-11-17, aeb
30 .\" Japanese Version Copyright (c) 1997 Tenkou N. Hattori
31 .\" all rights reserved.
32 .\" Translated Sat Jan 18 16:51:59 JST 1997
33 .\" by Tenkou N. Hattori <tnh@alpsmap.co.jp>
34 .\" Updated & Modified Sun Dec 9 15:25:20 JST 2001
35 .\" by Yuichi SATO <ysato@h4.dion.ne.jp>
37 .TH TMPFILE 3 2008-07-14 "" "Linux Programmer's Manual"
40 .\"O tmpfile \- create a temporary file
41 tmpfile \- ¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë
47 .B FILE *tmpfile(void);
53 .\"O function opens a unique temporary file
54 .\"O in binary read/write (w+b) mode.
55 .\"O The file will be automatically deleted when it is closed or the
56 .\"O program terminates.
58 ´Ø¿ô¤Ï¥æ¥Ë¡¼¥¯¤Ê¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤ò
59 ¥Ð¥¤¥Ê¥ê¥ê¡¼¥É¥é¥¤¥È¥â¡¼¥É (w+b) ¤Ç¥ª¡¼¥×¥ó¤¹¤ë¡£
60 ¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥¯¥í¡¼¥º»þ¤Þ¤¿¤Ï¥×¥í¥°¥é¥à¤Î½ªÎ»»þ¤Ë¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¡£
61 .\"O .SH "RETURN VALUE"
65 .\"O function returns a stream descriptor, or NULL if
66 .\"O a unique filename cannot be generated or the unique file cannot be
68 .\"O In the latter case, \fIerrno\fP is set to indicate the error.
70 ´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¤«¡¢
71 ¥æ¥Ë¡¼¥¯¤Ê¥Õ¥¡¥¤¥ë¤¬ºî¤ì¤Ê¤«¤Ã¤¿¤«¥ª¡¼¥×¥ó¤Ç¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
72 ¸å¼Ô¤Î¾ì¹ç¡¢¥¨¥é¡¼¤òɽ¤¹ \fIerrno\fP ¤òÀßÄꤹ¤ë¡£
77 .\"O Search permission denied for directory in file's path prefix.
78 ¥Õ¥¡¥¤¥ë¤Î¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥µ¡¼¥Á¤Î¥¢¥¯¥»¥¹¸¢ (search permission) ¤¬¤Ê¤¤¡£
81 .\"O Unable to generate a unique filename.
82 ¥æ¥Ë¡¼¥¯¤Ê¥Õ¥¡¥¤¥ë̾¤¬ºîÀ®¤Ç¤¤Ê¤«¤Ã¤¿¡£
85 .\"O The call was interrupted by a signal.
86 ¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤ÆÃæÃǤµ¤ì¤¿¡£
89 .\"O Too many file descriptors in use by the process.
90 1 ¤Ä¤Î¥×¥í¥»¥¹¤Ç»ÈÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¿ô¤òĶ²á¤·¤¿¡£
93 .\"O Too many files open in the system.
94 ¥·¥¹¥Æ¥àÁ´ÂΤǥª¡¼¥×¥ó²Äǽ¤Ê¥Õ¥¡¥¤¥ë¿ô¤òĶ²á¤·¤¿¡£
97 ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¿·¤·¤¤¥Õ¥¡¥¤¥ë¤òÄɲ乤뤿¤á¤Î¶õ¤Îΰ褬¤Ê¤¤¡£
100 .\"O Read-only file system.
101 ÆɤߤÀ¤·ÀìÍÑ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£
102 .\"O .SH "CONFORMING TO"
104 SVr4, 4.3BSD, C89, C99, SUSv2, POSIX.1-2001.
107 .\"O POSIX.1-2001 specifies:
108 .\"O an error message may be written to \fIstdout\fP if the stream
109 .\"O cannot be opened.
111 ¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤Ç¤¤Ê¤«¤Ã¤¿¾ì¹ç¡¢
112 \fIstdout\fP ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬½ñ¤½Ð¤µ¤ì¤ë¡¢¤Èµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
114 .\"O The standard does not specify the directory that
117 .\"O Glibc will try the path prefix \fIP_tmpdir\fP defined
118 .\"O in \fI<stdio.h>\fP, and if that fails the directory \fI/tmp\fP.
121 ¤¬»È¤¦¥Ç¥£¥ì¥¯¥È¥ê¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
122 glibc ¤Ç¤Ï \fI<stdio.h>\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë
123 \fIP_tmpdir\fP ¤ò¥Ñ¥¹¤ÎÀèƬ¤Ë»È¤ª¤¦¤È¤¹¤ë¡£
124 ¤³¤ì¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê \fI/tmp\fP ¤ò»È¤¦¡£