OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / man2 / mkdir.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" This manpage is Copyright (C) 1992 Drew Eckhardt;
4 .\"                               1993 Michael Haardt
5 .\"                               1993,1994 Ian Jackson.
6 .\" You may distribute it under the terms of the GNU General
7 .\" Public License. It comes with NO WARRANTY.
8 .\"
9 .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
10 .\"         all rights reserved.
11 .\" Translated Thu Jun 26 20:47:26 JST 1997
12 .\"         by SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
13 .\" Updated & Modified Fri Jan 22 1999
14 .\"         by NAKANO Takeo <nakano@apm.seikei.ac.jp>
15 .\" Updated Fri Sep 13 JST 2000 by Kentaro Shirakata <argrath@ub32.org>
16 .\" Updated Sun May 23 JST 2004 by Kentaro Shirakata <argrath@ub32.org>
17 .\" Updated Thu Mar 24 JST 2005 by Kentaro Shirakata <argrath@ub32.org>
18 .\" Updated Wed Jul 30 JST 2008 by Kentaro Shirakata <argrath@ub32.org>
19 .\"
20 .\"WORD:        permission      µö²Ä°À­
21 .\"WORD:        resolve         (¥Ñ¥¹Ì¾¤ò) ²ò·è¤¹¤ë
22 .\"
23 .TH MKDIR 2 2008-05-13 "Linux" "Linux Programmer's Manual"
24 .\"O .SH NAME
25 .SH Ì¾Á°
26 .\"O mkdir \- create a directory
27 mkdir \- ¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë
28 .\"O .SH SYNOPSIS
29 .SH ½ñ¼°
30 .nf
31 .B #include <sys/stat.h>
32 .B #include <sys/types.h>
33 .\" .B #include <unistd.h>
34 .sp
35 .BI "int mkdir(const char *" pathname ", mode_t " mode );
36 .fi
37 .\"O .SH DESCRIPTION
38 .SH ÀâÌÀ
39 .\"O .BR mkdir ()
40 .\"O attempts to create a directory named
41 .\"O .IR pathname .
42 .BR mkdir ()
43 ¤Ï
44 .I pathname
45 ¤Ç¼¨¤µ¤ì¤ë̾Á°¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤è¤¦¤È¤¹¤ë¡£
46
47 .\"O The argument
48 .\"O .I mode
49 .\"O specifies the permissions to use.
50 .\"O It is modified by the process's
51 .\"O .I umask
52 .\"O in the usual way: the permissions of the created directory are
53 .\"O .RI ( mode " & ~" umask " & 0777)."
54 .I mode
55 °ú¤­¿ô¤Ï¡¢ºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Îµö²Ä°À­¤ò·èÄꤹ¤ë¤Î¤Ë»È¤ï¤ì¤ë¡£
56 ¤³¤ÎÃͤˡ¢Ä̾ïÄ̤ê¥×¥í¥»¥¹¤Î
57 .I umask
58 ¤Ë¤è¤ë½¤Àµ¤¬²Ã¤¨¤é¤ì¤ë¡£
59 ¤·¤¿¤¬¤Ã¤Æ¡¢ºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Îµö²Ä°À­¤Ï
60 .RI ( mode " & ~" umask " & 0777)"
61 ¤È¤Ê¤ë¡£
62 .\"O Other mode bits of the created directory depend on the operating system.
63 .\"O For Linux, see below.
64 ºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¤½¤Î¾¤Î¥â¡¼¥É¥Ó¥Ã¥È¤Ï¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ë
65 °Í¸¤¹¤ë¡£Linux ¤Î¾ì¹ç¤Ï¡¢°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£
66
67 .\"O The newly created directory will be owned by the effective user ID of the
68 .\"O process.
69 .\"O If the directory containing the file has the set-group-ID
70 .\"O bit set, or if the file system is mounted with BSD group semantics
71 .\"O .RI ( "mount -o bsdgroups"
72 .\"O or, synonymously
73 .\"O .IR "mount -o grpid" ),
74 .\"O the new directory will inherit the group ownership from its parent;
75 .\"O otherwise it will be owned by the effective group ID of the process.
76 ¿·¤·¤¯ºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î½êÍ­¼Ô¤Ï¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶ ID ¤ËÀßÄꤵ¤ì¤ë¡£
77 ¿·¤¿¤ËºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬´Þ¤Þ¤ì¤ë¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ë
78 set group ID ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤¿¤ê¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ BSD ¤Î
79 ¥°¥ë¡¼¥×¥»¥Þ¥ó¥Æ¥£¥¯¥¹
80 .RI ( "mount -o bsdgroups"
81 ¤¢¤ë¤¤¤Ï¡¢Æ±¤¸°ÕÌ£¤Î
82 .IR "mount -o grpid" )
83 ¤Ë½¾¤Ã¤Æ¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢
84 ¿·¤¿¤ËºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¥°¥ë¡¼¥×½êÍ­¸¢¤Ï¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Î
85 ¤â¤Î¤¬·Ñ¾µ¤µ¤ì¤ë (¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤ÈƱ¤¸¤Ë¤Ê¤ë)¡£
86 ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¥°¥ë¡¼¥×½êÍ­¸¢¤Ï¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤È¤Ê¤ë¡£
87
88 .\"O If the parent directory has the set-group-ID bit set then so will the
89 .\"O newly created directory.
90 ¤â¤·¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ë set group ID ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ì¤Ð¿·¤·¤¯ºîÀ®¤µ¤ì¤ë
91 ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤â set group ID ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£
92 .\"O .SH "RETURN VALUE"
93 .SH ÊÖ¤êÃÍ
94 .\"O .BR mkdir ()
95 .\"O returns zero on success, or \-1 if an error occurred (in which case,
96 .\"O .I errno
97 .\"O is set appropriately).
98 .BR mkdir ()
99 ¤ÏÀ®¸ù¤·¤¿¾ì¹ç 0 ¤ò¡¢¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤òÊÖ¤¹ (¤Þ¤¿¡¢
100 .I errno
101 ¤¬¥¨¥é¡¼¤ÎÆâÍƤˤ·¤¿¤¬¤Ã¤ÆŬÀÚ¤ËÀßÄꤵ¤ì¤ë)¡£
102 .\"O .SH ERRORS
103 .SH ¥¨¥é¡¼
104 .TP
105 .B EACCES
106 .\"O The parent directory does not allow write permission to the process,
107 .\"O or one of the directories in
108 .\"O .I pathname
109 .\"O did not allow search permission.
110 .\"O (See also
111 .\"O .BR path_resolution (7).)
112 ¥×¥í¥»¥¹¤¬¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤¤¡¢¤â¤·¤¯¤Ï
113 .I pathname
114 Ãæ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤É¤ì¤«¤Ë¸¡º÷µö²Ä°À­¤¬Ìµ¤¤
115 .RB ( path_resolution (7)
116 ¤â»²¾È)¡£
117 .TP
118 .B EEXIST
119 .\"O .I pathname
120 .\"O already exists (not necessarily as a directory).
121 .I pathname
122 ¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤ë(¤¿¤À¤·¤½¤ì¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¤È¤Ï¸Â¤é¤Ê¤¤)¡£
123 .\"O This includes the case where
124 .\"O .I pathname
125 .\"O is a symbolic link, dangling or not.
126 .I pathname
127 ¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤â
128 (¤½¤Î»ØÄêÀ褬¸ºß¤¹¤ë¤«¤É¤¦¤«¤Ë´Ø¤é¤º)¥¨¥é¡¼¤Ë¤Ê¤ë¡£
129 .TP
130 .B EFAULT
131 .\"O .IR pathname " points outside your accessible address space."
132 .I pathname
133 ¤¬¤½¤Î¥×¥í¥»¥¹¤Î¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£
134 .TP
135 .B ELOOP
136 .\"O Too many symbolic links were encountered in resolving
137 .\"O .IR pathname .
138 ¥Ñ¥¹Ì¾
139 .I pathname
140 ¤ò²ò·è¤¹¤ë¤È¤­¤Ë¡¢²ò·è¤¹¤Ù¤­¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Â¿¤¹¤®¤¿¡£
141 .TP
142 .B ENAMETOOLONG
143 .\"O .IR pathname " was too long."
144 .I pathname
145 ¤¬Ä¹¤¹¤®¤ë¡£
146 .TP
147 .B ENOENT
148 .\"O A directory component in
149 .\"O .I pathname
150 .\"O does not exist or is a dangling symbolic link.
151 .I pathname
152 ¤Î¹½À®Í×ÁǤΥǥ£¥ì¥¯¥È¥ê¤Î¤¤¤º¤ì¤«¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢
153 ¤Þ¤¿¤Ï¥ê¥ó¥¯À褬¸ºß¤·¤Ê¤¤¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¡£
154 .TP
155 .B ENOMEM
156 .\"O Insufficient kernel memory was available.
157 ¥«¡¼¥Í¥ë¤Ë¡¢ÍøÍѤǤ­¤ë¥á¥â¥ê¤¬ÉÔ­¤·¤Æ¤¤¤ë¡£
158 .TP
159 .B ENOSPC
160 .\"O The device containing
161 .\"O .I pathname
162 .\"O has no room for the new directory.
163 .I pathname
164 ¤ò´Þ¤à¥Ç¥Ð¥¤¥¹¤Ë¿·¤¿¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë¶õ¤­¤¬Ìµ¤¤¡£
165 .TP
166 .B ENOSPC
167 .\"?? ENOSPC ¤¬¥À¥Ö¤Ã¤Æ¤¤¤ë¤±¤É...
168 .\"O The new directory cannot be created because the user's disk quota is
169 .\"O exhausted.
170 ¤â¤·¤¯¤Ï¥æ¡¼¥¶¡¼¤Î¥Ç¥£¥¹¥¯ quota ¤¬»È¤¤ÀÚ¤é¤ì¤Æ¤¤¤ë¤¿¤á¡¢
171 ¿·¤¿¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£
172 .TP
173 .B ENOTDIR
174 .\"O A component used as a directory in
175 .\"O .I pathname
176 .\"O is not, in fact, a directory.
177 .I pathname
178 Ãæ¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£
179 .TP
180 .B EPERM
181 .\"O The file system containing
182 .\"O .I pathname
183 .\"O does not support the creation of directories.
184 .I pathname
185 ¤ò´Þ¤à¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥Ç¥£¥ì¥¯¥È¥ê¤ÎºîÀ®¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£
186 .TP
187 .B EROFS
188 .\"O .I pathname
189 .\"O refers to a file on a read-only file system.
190 .I pathname
191 ¤¬Æɤ߽Ф·ÀìÍÑ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤ë¡£
192 .\"O .SH "CONFORMING TO"
193 .SH ½àµò
194 .\"O SVr4, BSD, POSIX.1-2001.
195 .\"O .\" SVr4 documents additional EIO, EMULTIHOP
196 SVr4, BSD, POSIX.1-2001.
197 .\" SVr4 ¤Ë¤Ï¤µ¤é¤Ë¥¨¥é¡¼¥³¡¼¥É EIO, EMULTIHOP ¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£
198 .\"O .SH NOTES
199 .SH Ãí°Õ
200 .\"O Under Linux apart from the permission bits, only the
201 .\"O .B S_ISVTX
202 .\"O mode bit is honored.
203 .\"O That is, under Linux the created directory actually gets mode
204 .\"O .RI ( mode " & ~" umask " & 01777)."
205 .\"O See also
206 .\"O .BR stat (2).
207 Linux ¤Ç¤Ï¡¢µö²Ä¥Ó¥Ã¥È°Ê³°¤Ç°ÕÌ£¤ò»ý¤Ä¤Î¤Ï¡¢
208 .B S_ISVTX
209 ¥â¡¼¥É¥Ó¥Ã¥È¤À¤±¤Ç¤¢¤ë¡£
210 ¤Ä¤Þ¤ê¡¢Linux ¤Ç¤ÏºîÀ®¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ï¼ÂºÝ¤Ë¤Ï
211 .RI ( mode " & ~" umask " & 01777)"
212 ¤Î¥â¡¼¥É¤ò»ý¤Ä¤³¤È¤Ë¤Ê¤ë¡£
213 .BR stat (2)
214 ¤ò»²¾È¤Î¤³¤È¡£
215 .PP
216 .\"O There are many infelicities in the protocol underlying NFS.
217 .\"O Some of these affect
218 .\"O .BR mkdir ().
219 NFS ¤ò¼Â¸½¤·¤Æ¤¤¤ë¥×¥í¥È¥³¥ë¤Ë¤Ï¿¤¯¤ÎÉÔÈ÷¤¬Â¸ºß¤·¡¢
220 ¤½¤ì¤éÃæ¤Ë¤Ï
221 .BR mkdir ()
222 ¤Ë±Æ¶Á¤òÍ¿¤¨¤ë¤â¤Î¤â¤¢¤ë¡£
223 .\"O .SH "SEE ALSO"
224 .SH ´ØÏ¢¹àÌÜ
225 .BR mkdir (1),
226 .BR chmod (2),
227 .BR chown (2),
228 .BR mkdirat (2),
229 .BR mknod (2),
230 .BR mount (2),
231 .BR rmdir (2),
232 .BR stat (2),
233 .BR umask (2),
234 .BR unlink (2),
235 .BR path_resolution (7)