OSDN Git Service

1646cf1d5e3ad90ae29564e6b78c5a49f4c1c425
[linuxjm/LDP_man-pages.git] / draft / man3 / tmpfile.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
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.
6 .\"
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.
11 .\"
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
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified Sat Jul 24 17:46:57 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified 2001-11-17, aeb
29 .\"
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>
36 .\"
37 .TH TMPFILE 3  2008-07-14 "" "Linux Programmer's Manual"
38 .\"O .SH NAME
39 .SH 名前
40 .\"O tmpfile \- create a temporary file
41 tmpfile \- テンポラリファイルを作成する
42 .\"O .SH SYNOPSIS
43 .SH 書式
44 .nf
45 .B #include <stdio.h>
46 .sp
47 .B FILE *tmpfile(void);
48 .fi
49 .\"O .SH DESCRIPTION
50 .SH 説明
51 .\"O The
52 .\"O .BR tmpfile ()
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.
57 .BR tmpfile ()
58 関数はユニークなテンポラリファイルを
59 バイナリリードライトモード (w+b) でオープンする。
60 このファイルはクローズ時またはプログラムの終了時に自動的に削除される。
61 .\"O .SH "RETURN VALUE"
62 .SH 返り値
63 .\"O The
64 .\"O .BR tmpfile ()
65 .\"O function returns a stream descriptor, or NULL if
66 .\"O a unique filename cannot be generated or the unique file cannot be
67 .\"O opened.
68 .\"O In the latter case, \fIerrno\fP is set to indicate the error.
69 .BR tmpfile ()
70 関数はファイルポインタを返すか、
71 ユニークなファイルが作れなかったかオープンできなかった場合は NULL を返す。
72 後者の場合、エラーを表す \fIerrno\fP を設定する。
73 .\"O .SH ERRORS
74 .SH エラー
75 .TP
76 .B EACCES
77 .\"O Search permission denied for directory in file's path prefix.
78 ファイルのあるディレクトリにサーチのアクセス権 (search permission) がない。
79 .TP
80 .B EEXIST
81 .\"O Unable to generate a unique filename.
82 ユニークなファイル名が作成できなかった。
83 .TP
84 .B EINTR
85 .\"O The call was interrupted by a signal.
86 呼び出しがシグナルによって中断された。
87 .TP
88 .B EMFILE
89 .\"O Too many file descriptors in use by the process.
90 1 つのプロセスで使用可能なファイルディスクリプタ数を超過した。
91 .TP
92 .B ENFILE
93 .\"O Too many files open in the system.
94 システム全体でオープン可能なファイル数を超過した。
95 .TP
96 .B ENOSPC
97 ディレクトリに新しいファイルを追加するための空き領域がない。
98 .TP
99 .B EROFS
100 .\"O Read-only file system.
101 読みだし専用ファイルシステムである。
102 .\"O .SH "CONFORMING TO"
103 .SH 準拠
104 SVr4, 4.3BSD, C89, C99, SUSv2, POSIX.1-2001.
105 .\"O .SH NOTES
106 .SH 注意
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.
110 POSIX.1-2001 では、
111 ストリームをオープンできなかった場合、
112 \fIstdout\fP にエラーメッセージが書き出される、と規定されている。
113 .LP
114 .\"O The standard does not specify the directory that
115 .\"O .BR tmpfile ()
116 .\"O will use.
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.
119 規格では
120 .BR tmpfile ()
121 が使うディレクトリは指定されていない。
122 glibc では \fI<stdio.h>\fP で定義されている
123 \fIP_tmpdir\fP をパスの先頭に使おうとする。
124 これが失敗した場合は、ディレクトリ \fI/tmp\fP を使う。
125 .\"O .SH "SEE ALSO"
126 .SH 関連項目
127 .BR exit (3),
128 .BR mkstemp (3),
129 .BR mktemp (3),
130 .BR tempnam (3),
131 .BR tmpnam (3)