.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 17:46:57 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified 2001-11-17, aeb .\" .\" Japanese Version Copyright (c) 1997 Tenkou N. Hattori .\" all rights reserved. .\" Translated Sat Jan 18 16:51:59 JST 1997 .\" by Tenkou N. Hattori .\" Updated & Modified Sun Dec 9 15:25:20 JST 2001 .\" by Yuichi SATO .\" .TH TMPFILE 3 2008-07-14 "" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O tmpfile \- create a temporary file tmpfile \- テンポラリファイルを作成する .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .B FILE *tmpfile(void); .fi .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR tmpfile () .\"O function opens a unique temporary file .\"O in binary read/write (w+b) mode. .\"O The file will be automatically deleted when it is closed or the .\"O program terminates. .BR tmpfile () 関数はユニークなテンポラリファイルを バイナリリードライトモード (w+b) でオープンする。 このファイルはクローズ時またはプログラムの終了時に自動的に削除される。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O The .\"O .BR tmpfile () .\"O function returns a stream descriptor, or NULL if .\"O a unique filename cannot be generated or the unique file cannot be .\"O opened. .\"O In the latter case, \fIerrno\fP is set to indicate the error. .BR tmpfile () 関数はファイルポインタを返すか、 ユニークなファイルが作れなかったかオープンできなかった場合は NULL を返す。 後者の場合、エラーを表す \fIerrno\fP を設定する。 .\"O .SH ERRORS .SH エラー .TP .B EACCES .\"O Search permission denied for directory in file's path prefix. ファイルのあるディレクトリにサーチのアクセス権 (search permission) がない。 .TP .B EEXIST .\"O Unable to generate a unique filename. ユニークなファイル名が作成できなかった。 .TP .B EINTR .\"O The call was interrupted by a signal. 呼び出しがシグナルによって中断された。 .TP .B EMFILE .\"O Too many file descriptors in use by the process. 1 つのプロセスで使用可能なファイルディスクリプタ数を超過した。 .TP .B ENFILE .\"O Too many files open in the system. システム全体でオープン可能なファイル数を超過した。 .TP .B ENOSPC ディレクトリに新しいファイルを追加するための空き領域がない。 .TP .B EROFS .\"O Read-only file system. 読みだし専用ファイルシステムである。 .\"O .SH "CONFORMING TO" .SH 準拠 SVr4, 4.3BSD, C89, C99, SUSv2, POSIX.1-2001. .\"O .SH NOTES .SH 注意 .\"O POSIX.1-2001 specifies: .\"O an error message may be written to \fIstdout\fP if the stream .\"O cannot be opened. POSIX.1-2001 では、 ストリームをオープンできなかった場合、 \fIstdout\fP にエラーメッセージが書き出される、と規定されている。 .LP .\"O The standard does not specify the directory that .\"O .BR tmpfile () .\"O will use. .\"O Glibc will try the path prefix \fIP_tmpdir\fP defined .\"O in \fI\fP, and if that fails the directory \fI/tmp\fP. 規格では .BR tmpfile () が使うディレクトリは指定されていない。 glibc では \fI\fP で定義されている \fIP_tmpdir\fP をパスの先頭に使おうとする。 これが失敗した場合は、ディレクトリ \fI/tmp\fP を使う。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR exit (3), .BR mkstemp (3), .BR mktemp (3), .BR tempnam (3), .BR tmpnam (3)