OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man3 / mkdtemp.3
1 .\" Copyright 2001 John Levon <moz@compsoc.man.ac.uk>
2 .\" Based on mkstemp(3), Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" and GNU libc documentation
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Japanese Version Copyright (c) 2001 Yuichi SATO
26 .\"         all rights reserved.
27 .\" Translated Sun Oct 21 03:28:34 JST 2001
28 .\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
29 .\"
30 .TH MKDTEMP 3  2010-09-26 "GNU" "Linux Programmer's Manual"
31 .\"O .SH NAME
32 .SH Ì¾Á°
33 .\"O mkdtemp \- create a unique temporary directory
34 mkdtemp \- Â¾¤È½Å¤Ê¤é¤Ê¤¤°ì»þŪ¤Ê¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë
35 .\"O .SH SYNOPSIS
36 .SH ½ñ¼°
37 .nf
38 .B #include <stdlib.h>
39 .sp
40 .BI "char *mkdtemp(char *" template );
41 .fi
42 .sp
43 .in -4n
44 .\"O Feature Test Macro Requirements for glibc (see
45 .\"O .BR feature_test_macros (7)):
46 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
47 .RB ( feature_test_macros (7)
48 »²¾È):
49 .in
50 .sp
51 .BR mkdtemp ():
52 .br
53 .ad l
54 .RS 4
55 .PD 0
56 _BSD_SOURCE
57 .br
58 || /* Since glibc 2.10: */
59 .RS 4
60 (_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700)
61 .ad
62 .PD
63 .RE
64 .\"O .SH DESCRIPTION
65 .SH ÀâÌÀ
66 .\"O The
67 .\"O .BR mkdtemp ()
68 .\"O function generates a uniquely named temporary
69 .\"O directory from \fItemplate\fP.
70 .\"O The last six characters of \fItemplate\fP
71 .\"O must be XXXXXX and these are replaced with a string that makes the
72 .\"O directory name unique.
73 .\"O The directory is then created with
74 .\"O permissions 0700.
75 .BR mkdtemp ()
76 ´Ø¿ô¤Ï¡¢Â¾¤È½Å¤Ê¤é¤Ê¤¤Ì¾Á°¤Î°ì»þŪ¤Ê¥Ç¥£¥ì¥¯¥È¥ê¤ò
77 \fItemplate\fP ¤«¤éºîÀ®¤¹¤ë¡£
78 \fItemplate\fP ¤Î¸å¤«¤é 6 Ê¸»ú¤Ï XXXXXX ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
79 ¤³¤ÎÉôʬ¤Ï¥Ç¥£¥ì¥¯¥È¥ê̾¤ò¾¤È½Å¤Ê¤é¤Ê¤¯¤¹¤ë¤¿¤á¤Î
80 ʸ»úÎó¤ÇÃÖ¤­´¹¤¨¤é¤ì¤ë¡£
81 ¥Ç¥£¥ì¥¯¥È¥ê¤Ïµö²Ä°À­¤ò 0700 ¤È¤·¤ÆºîÀ®¤µ¤ì¤ë¡£
82 .\"O Since it will be modified,
83 .\"O .I template
84 .\"O must not be a string constant, but should be declared as a character array.
85 .I template
86 ¤ÏÊѹ¹¤µ¤ì¤ë¤Î¤Ç¡¢Ê¸»úÎóÄê¿ô¤Ë¤·¤Æ¤Ï¤Ê¤é¤º¡¢Ê¸»úÇÛÎó¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£
87 .\"O .SH "RETURN VALUE"
88 .SH ÊÖ¤êÃÍ
89 .\"O The
90 .\"O .BR mkdtemp ()
91 .\"O function returns a pointer to the modified template
92 .\"O string on success, and NULL on failure, in which case
93 .\"O .I errno
94 .\"O is set appropriately.
95 À®¸ù¤·¤¿¾ì¹ç¡¢
96 .BR mkdtemp ()
97 ´Ø¿ô¤Ï
98 Êѹ¹¤µ¤ì¤¿ template Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
99 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢NULL ¤òÊÖ¤·¤Æ¡¢
100 .I errno
101 ¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£
102 .\"O .SH ERRORS
103 .SH ¥¨¥é¡¼
104 .TP
105 .B EINVAL
106 .\"O The last six characters of \fItemplate\fP were not XXXXXX.
107 .\"O Now \fItemplate\fP is unchanged.
108 \fItemplate\fP ¤Î¸å¤í¤«¤é 6 Ê¸»ú¤¬ XXXXXX ¤Ç¤Ê¤¤¡£
109 ¤³¤Î¾ì¹ç¡¢\fItemplate\fP ¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£
110 .PP
111 .\"O Also see
112 .\"O .BR mkdir (2)
113 .\"O for other possible values for \fIerrno\fP.
114 \fIerrno\fP ¤ËÀßÄꤵ¤ì¤ë¾¤ÎÃͤˤĤ¤¤Æ¤Ï¡¢
115 .BR mkdir (2)
116 ¤ò»²¾È¤¹¤ë¤³¤È¡£
117 .\"O .SH VERSIONS
118 .SH ¥Ð¡¼¥¸¥ç¥ó
119 .\"O Available since glibc 2.1.91.
120 OpenBSD 2.2 ¤ÇƳÆþ¤µ¤ì¤¿¡£
121 .\"O .SH "CONFORMING TO"
122 .SH ½àµò
123 POSIX.1-2008.
124 .\"O This function is present on the BSDs.
125 .\"O .\" As at 2006, this function is being considered for a revision of POSIX.1
126 .\"O .\" Also in NetBSD 1.4.
127 ¤³¤Î´Ø¿ô¤Ï BSD ¤Ë¸ºß¤¹¤ë¡£
128 .\" 2006 Ç¯»þÅÀ¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Ï POSIX.1 ¤ËÆþ¤ì¤ë¤«¸¡Æ¤Ãæ¤Ç¤¢¤ë¡£
129 .\" NetBSD 1.4 ¤Ë¤â¤¢¤ë¡£
130 .\"O .SH "SEE ALSO"
131 .SH ´ØÏ¢¹àÌÜ
132 .BR mkdir (2),
133 .BR mkstemp (3),
134 .BR mktemp (3),
135 .BR tempnam (3),
136 .BR tmpfile (3),
137 .BR tmpnam (3)