OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / rename.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,1995 Ian Jackson.
6 .\"
7 .\" Permission is granted to make and distribute verbatim copies of this
8 .\" manual provided the copyright notice and this permission notice are
9 .\" preserved on all copies.
10 .\"
11 .\" Permission is granted to copy and distribute modified versions of this
12 .\" manual under the conditions for verbatim copying, provided that the
13 .\" entire resulting derived work is distributed under the terms of a
14 .\" permission notice identical to this one.
15 .\"
16 .\" Since the Linux kernel and libraries are constantly changing, this
17 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
18 .\" responsibility for errors or omissions, or for damages resulting from
19 .\" the use of the information contained herein.  The author(s) may not
20 .\" have taken the same level of care in the production of this manual,
21 .\" which is licensed free of charge, as they might when working
22 .\" professionally.
23 .\"
24 .\" Formatted or processed versions of this manual, if unaccompanied by
25 .\" the source, must acknowledge the copyright and authors of this work.
26 .\"
27 .\" Modified Sat Jul 24 00:35:52 1993 by Rik Faith <faith@cs.unc.edu>
28 .\" Modified Thu Jun  4 12:21:13 1998 by Andries Brouwer <aeb@cwi.nl>
29 .\" Modified Thu Mar  3 09:49:35 2005 by Michael Haardt <michael@moria.de>
30 .\" 2007-03-25, mtk, added various text to DESCRIPTION.
31 .\"
32 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
33 .\"         all rights reserved.
34 .\" Translated Fri Dec 12 00:15:52 JST 1997
35 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
36 .\" Updated & Modified Thu Feb 10 07:23:59 JST 2005
37 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
38 .\" Updated & Modified Fri Apr 22 03:21:04 JST 2005 by Yuichi SATO
39 .\" Updated 2007-05-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.44
40 .\" Updated 2009-04-24, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.20
41 .\"
42 .\"WORD:        directory               ¥Ç¥£¥ì¥¯¥È¥ê
43 .\"WORD:        hard link               ¥Ï¡¼¥É¡¦¥ê¥ó¥¯
44 .\"WORD:        overwrite               ¾å½ñ¤­(overwrite)
45 .\"WORD:        process                 ¥×¥í¥»¥¹
46 .\"WORD:        crash                   ¥¯¥é¥Ã¥·¥å
47 .\"WORD:        symbolic link           ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯
48 .\"WORD:        working directory       ¥ï¡¼¥­¥ó¥°¡¦¥Ç¥£¥ì¥¯¥È¥ê
49 .\"WORD:        root directory          ¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê
50 .\"WORD:        effective uid           ¼Â¸ú¥æ¡¼¥¶¡¼ID
51 .\"WORD:        sticky bit              ¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È
52 .\"WORD:        memory                  ¥á¥â¥ê
53 .\"WORD:        read-only               Æɤ߹þ¤ßÀìÍÑ
54 .\"WORD:        uid                     ¥æ¡¼¥¶¡¼ID
55 .\"WORD:        dangling symbolic link  ²õ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯
56 .\"WORD:        server                  ¥µ¡¼¥Ð¡¼
57 .\"
58 .TH RENAME 2 2009-03-30 "Linux" "Linux Programmer's Manual"
59 .\"O .SH NAME
60 .SH Ì¾Á°
61 .\"O rename \- change the name or location of a file
62 rename \- ¥Õ¥¡¥¤¥ë¤Î̾Á°¤ä°ÌÃÖ¤òÊѹ¹¤¹¤ë
63 .\"O .SH SYNOPSIS
64 .SH ½ñ¼°
65 .B #include <stdio.h>
66 .sp
67 .BI "int rename(const char *" oldpath ", const char *" newpath );
68 .\"O .SH DESCRIPTION
69 .SH ÀâÌÀ
70 .\"O .BR rename ()
71 .\"O renames a file, moving it between directories if required.
72 .BR rename ()
73 ¤Ï¥Õ¥¡¥¤¥ë¤Î̾Á°¤òÊѹ¹¤·¡¢É¬Íפʤé¤Ð¥Ç¥£¥ì¥¯¥È¥ê´Ö¤Î°ÜÆ°¤ò¹Ô¤Ê¤¦¡£
74 .\"O Any other hard links to the file (as created using
75 .\"O .BR link (2))
76 .\"O are unaffected.
77 ¤½¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë
78 .RB ( link (2)
79 ¤ò»ÈÍѤ·¤Æºî¤é¤ì¤¿) Â¾¤Î¥Ï¡¼¥É¥ê¥ó¥¯ (hard link) ¤Ë¤Ï±Æ¶Á¤Ï¤Ê¤¤¡£
80 .\"O Open file descriptors for
81 .\"O .I oldpath
82 .\"O are also unaffected.
83 ¥ª¡¼¥×¥óºÑ¤Î
84 .I oldpath
85 ¤ËÂФ¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤â±Æ¶Á¤Ï¤Ê¤¤¡£
86
87 .\"O If
88 .\"O .I newpath
89 .\"O already exists it will be atomically replaced (subject to
90 .\"O a few conditions; see ERRORS below), so that there is
91 .\"O no point at which another process attempting to access
92 .\"O .I newpath
93 .\"O will find it missing.
94 .I newpath
95 ¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢¤½¤ì¤ÏÉÔ²ÄʬÁàºî¤Ç (atomically) ÃÖ¤­´¹¤¨¤é¤ì¤ë
96 (¤¿¤À¤·¡¢¤¤¤¯¤Ä¤«¤Î¾ò·ï¤¬¤¢¤ë; °Ê²¼¤Î¡Ö¥¨¥é¡¼¡×¤Î¥»¥¯¥·¥ç¥ó¤ò»²¾È)¡£
97 ¤½¤Î¤¿¤á¡¢
98 .I newpath
99 ¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¾¤Î¥×¥í¥»¥¹¤¬¥Õ¥¡¥¤¥ë¤ò¸«¼º¤¦¤³¤È¤Ï¤Ê¤¤
100 (ÌõÃð: ¾ï¤Ë¥¢¥¯¥»¥¹²Äǽ¤Ç¤¢¤ë)¡£
101
102 .\"O If
103 .\"O .I oldpath
104 .\"O and
105 .\"O .I newpath
106 .\"O are existing hard links referring to the same file, then
107 .\"O .BR rename ()
108 .\"O does nothing, and returns a success status.
109 .I oldpath
110 ¤È
111 .I newpath
112 ¤¬¤É¤Á¤é¤â´û¸¤Î¥Ï¡¼¥É¥ê¥ó¥¯¤Ç¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¡¢
113 .BR rename ()
114 ¤Ï²¿¤â¹Ô¤ï¤º¡¢¥¹¥Æ¡¼¥¿¥¹¤È¤·¤ÆÀ®¸ù¤òÊÖ¤¹¡£
115
116 .\"O If
117 .\"O .I newpath
118 .\"O exists but the operation fails for some reason
119 .\"O .BR rename ()
120 .\"O guarantees to leave an instance of
121 .\"O .I newpath
122 .\"O in place.
123 .I newpath
124 ¤¬Â¸ºß¤·¡¢²¿¤é¤«¤ÎÍýͳ¤ÇÁàºî¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢
125 .BR rename ()
126 ¤Ï
127 .I newpath
128 ¤Î¼ÂÂΤò¸µ¤Î¤Þ¤Þ»Ä¤¹¤³¤È¤òÊݾڤ¹¤ë¡£
129
130 .\"O .I oldpath
131 .\"O can specify a directory.
132 .\"O In this case,
133 .\"O .I newpath
134 .\"O must either not exist, or it must specify an empty directory.
135 .I oldpath
136 ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£
137 ¤³¤Î¾ì¹ç¡¢
138 .I newpath
139 ¤Ï¸ºß¤·¤Ê¤¤¤«¡¢¶õ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
140
141 .\"O However, when overwriting there will probably be a window in which
142 .\"O both
143 .\"O .I oldpath
144 .\"O and
145 .\"O .I newpath
146 .\"O refer to the file being renamed.
147 °ìÊý¤Ç¡¢¾å½ñ¤­¤ò¹Ô¤Ê¤¦¾ì¹ç¤Ï¡¢rename ¤¬¹Ô¤Ê¤ï¤ì¤ë¥Õ¥¡¥¤¥ë¤ò
148 .I oldpath
149 ¤È
150 .I newpath
151 ¤ÎξÊý¤Ç»²¾È¤Ç¤­¤ë½Ö´Ö¤¬¤ª¤½¤é¤¯Â¸ºß¤¹¤ë¡£
152
153 .\"O If
154 .\"O .I oldpath
155 .\"O refers to a symbolic link the link is renamed; if
156 .\"O .I newpath
157 .\"O refers to a symbolic link the link will be overwritten.
158 .I oldpath
159 ¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯ (symbolic link) ¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢
160 ¥ê¥ó¥¯¤Î̾Á°¤¬Êѹ¹¤µ¤ì¤ë¡£
161 ¤Þ¤¿¡¢
162 .I newpath
163 ¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤ò»²¾È¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥ê¥ó¥¯¤¬¾å½ñ¤­¤µ¤ì¤ë¡£
164 .\"O .SH "RETURN VALUE"
165 .SH ÊÖ¤êÃÍ
166 .\"O On success, zero is returned.
167 .\"O On error, \-1 is returned, and
168 .\"O .I errno
169 .\"O is set appropriately.
170 À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢
171 .I errno
172 ¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£
173 .\"O .SH ERRORS
174 .SH ¥¨¥é¡¼
175 .TP
176 .B EACCES
177 .\"O Write permission is denied for the directory containing
178 .\"O .I oldpath
179 .\"O or
180 .\"O .IR newpath ,
181 .\"O or, search permission is denied for one of the directories
182 .\"O in the path prefix of
183 .\"O .I oldpath
184 .\"O or
185 .\"O .IR newpath ,
186 .\"O or
187 .\"O .I oldpath
188 .\"O is a directory and does not allow write permission (needed to update
189 .\"O the
190 .\"O .I ..
191 .\"O entry).
192 .\"O (See also
193 .\"O .BR path_resolution (7).)
194 .IR oldpath " ¤Þ¤¿¤Ï " newpath
195 ¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤¤¡£
196 ¤Þ¤¿¤Ï¡¢
197 .IR oldpath " ¤Þ¤¿¤Ï " newpath
198 ¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Î¤É¤ì¤«¤Ë¸¡º÷µö²Ä¤¬¤Ê¤¤¡£
199 ¤Þ¤¿¤Ï¡¢
200 .I oldpath
201 ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç
202 .RI ( ..
203 ¥¨¥ó¥È¥ê¤ò¹¹¿·¤¹¤ë¤Î¤ËɬÍפÊ) ½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤¤
204 .RB ( path_resolution (7)
205 ¤â»²¾È)¡£
206 .TP
207 .B EBUSY
208 .\"O The rename fails because
209 .\"O .IR oldpath " or " newpath
210 .\"O is a directory that is in use by some process (perhaps as
211 .\"O current working directory, or as root directory, or because
212 .\"O it was open for reading) or is in use by the system
213 .\"O (for example as mount point), while the system considers
214 .\"O this an error.
215 .IR oldpath " ¤Þ¤¿¤Ï " newpath
216 ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¡¢²¿¤é¤«¤Î¥×¥í¥»¥¹¤¬»ÈÍÑÃæ
217 (¿ʬ¡¢¥«¥ì¥ó¥È¡¦¥ï¡¼¥­¥ó¥°¡¦¥Ç¥£¥ì¥¯¥È¥ê¤«¡¢¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤«¡¢
218 Æɤ߹þ¤ß¤Î¤¿¤á¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¤«¤Ç¤í¤¦)
219 ¤â¤·¤¯¤Ï¡¢¥·¥¹¥Æ¥à¤¬»ÈÍÑÃæ (Î㤨¤Ð¥Þ¥¦¥ó¥È¡¦¥Ý¥¤¥ó¥È¤Ç¤¢¤ë)
220 ¤Ç¤¢¤ê¡¢¥·¥¹¥Æ¥à¤¬¤³¤ì¤ò¥¨¥é¡¼¤Ç¤¢¤ë¤ÈȽÃǤ·¤¿¤¿¤á¤Ë rename ¤¬¼ºÇÔ¤·¤¿¡£
221 .\"O (Note that there is no requirement to return
222 .\"O .B EBUSY
223 .\"O in such
224 .\"O cases \(em there is nothing wrong with doing the rename anyway \(em
225 .\"O but it is allowed to return
226 .\"O .B EBUSY
227 .\"O if the system cannot otherwise
228 .\"O handle such situations.)
229 (¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë
230 .B EBUSY
231 ¤òÊÖ¤¹¤³¤È¤Ïµ¬³Ê¤Ç¤ÏÍ׵ᤵ¤ì¤Æ¤¤¤Ê¤¤ÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£
232 ¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¡¢rename ¤ò¤È¤Ë¤«¤¯¼Â¹Ô¤·¤Æ¤ß¤ë¤Î¤Ï²¿¤ÎÌäÂê¤â¤Ê¤¤¡£
233 ¤¿¤À¤·¡¢¤½¤Î¤è¤¦¤Ê¾õ¶·¤Ç¡¢¥·¥¹¥Æ¥à¤¬Â¾¤ËÊÖ¤¹¥¨¥é¡¼¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï
234 .B EBUSY
235 ¤òÊÖ¤¹¤³¤È¤¬µö¤µ¤ì¤Æ¤¤¤ë¡£)
236 .TP
237 .B EFAULT
238 .\"O .IR oldpath " or " newpath " points outside your accessible address space."
239 .IR oldpath " ¤Þ¤¿¤Ï " newpath
240 ¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£
241 .TP
242 .B EINVAL
243 .\"O The new pathname contained a path prefix of the old, or, more generally,
244 .\"O an attempt was made to make a directory a subdirectory of itself.
245 .IR newpath " ¤¬ " oldpath
246 ¤Î¥Ñ¥¹Éôʬ¤ò´Þ¤ó¤Ç¤¤¤ë¡£¥Ç¥£¥ì¥¯¥È¥ê¤ò¼«Ê¬¼«¿È¤Î¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë
247 Êѹ¹¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤¬¤Û¤È¤ó¤É¤Ç¤¢¤ë¡£
248 .TP
249 .B EISDIR
250 .\"O .I newpath
251 .\"O is an existing directory, but
252 .\"O .I oldpath
253 .\"O is not a directory.
254 .I newpath
255 ¤Ï¸ºß¤·¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¤¬¡¢
256 .I oldpath
257 ¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£
258 .TP
259 .B ELOOP
260 .\"O Too many symbolic links were encountered in resolving
261 .\"O .IR oldpath " or " newpath .
262 .IR oldpath " ¤Þ¤¿¤Ï " newpath
263 ¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£
264 .TP
265 .B EMLINK
266 .\"O .I oldpath
267 .\"O already has the maximum number of links to it, or
268 .\"O it was a directory and the directory containing
269 .\"O .I newpath
270 .\"O has the maximum number of links.
271 .I oldpath
272 ¤Ï´û¤ËºÇÂç¿ô¤Þ¤Ç¤Î¥ê¥ó¥¯¤ò»ý¤Ã¤Æ¤¤¤ë¤«¡¢¤½¤ì¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç
273 .I newpath
274 ¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤¬ºÇÂç¿ô¤Þ¤Ç¤Î¥ê¥ó¥¯¤ò»ý¤Ã¤Æ¤¤¤ë¡£
275 .TP
276 .B ENAMETOOLONG
277 .\"O .IR oldpath " or " newpath " was too long."
278 .IR oldpath " ¤Þ¤¿¤Ï " newpath " ¤¬Ä¹²á¤®¤ë¡£"
279 .TP
280 .B ENOENT
281 .\"O The link named by
282 .\"O .I oldpath
283 .\"O does not exist;
284 .\"O or, a directory component in
285 .\"O .I newpath
286 .\"O does not exist;
287 .\"O or,
288 .\"O .I oldpath
289 .\"O or
290 .\"O .I newpath
291 .\"O is an empty string.
292 .I oldpath
293 ¤È¤¤¤¦Ì¾Á°¤Î¥ê¥ó¥¯¤¬Â¸ºß¤·¤Ê¤¤¡£
294 ¤Þ¤¿¤Ï¡¢
295 .I newpath
296 ¤È¤¤¤¦¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Ê¤¤¡£
297 ¤Þ¤¿¤Ï¡¢
298 .I oldpath
299 ¤«
300 .I newpath
301 ¤¬¶õ¤Îʸ»úÎó¤Ç¤¢¤ë¡£
302 .TP
303 .B ENOMEM
304 .\"O Insufficient kernel memory was available.
305 ¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬Â¸ºß¤·¤Ê¤¤¡£
306 .TP
307 .B ENOSPC
308 .\"O The device containing the file has no room for the new directory
309 .\"O entry.
310 ¥Õ¥¡¥¤¥ë¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥Ð¥¤¥¹¤Ë¿·¤·¤¤¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤ò
311 ºîÀ®¤¹¤ë¤¿¤á¤Î¶õ¤­¤¬¤Ê¤¤¡£
312 .TP
313 .B ENOTDIR
314 .\"O A component used as a directory in
315 .\"O .IR oldpath " or " newpath
316 .\"O is not, in fact, a directory.
317 .IR oldpath " ¤« " newpath
318 ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬
319 ¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£
320 .\"O Or,
321 .\"O .I oldpath
322 .\"O is a directory, and
323 .\"O .I newpath
324 .\"O exists but is not a directory.
325 ¤Þ¤¿¤Ï
326 .I oldpath
327 ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¡¢
328 .I newpath
329 ¤¬Â¸ºß¤·¤Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£
330 .TP
331 .\"O .BR ENOTEMPTY " or " EEXIST
332 .B ENOTEMPTY " ¤Þ¤¿¤Ï " EEXIST
333 .\"O .I newpath
334 .\"O is a nonempty directory, that is, contains entries other than "." and "..".
335 .I newpath
336 ¤¬¶õ¤Ç¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¡£¤¹¤Ê¤ï¤Á "." ¤È ".." °Ê³°¤ò´Þ¤ó¤Ç¤¤¤ë¡£
337 .TP
338 .\"O .BR EPERM " or " EACCES
339 .BR EPERM " ¤Þ¤¿¤Ï " EACCES
340 .\"O The directory containing
341 .\"O .I oldpath
342 .\"O has the sticky bit
343 .\"O .RB ( S_ISVTX )
344 .\"O set and the process's effective user ID is neither
345 .\"O the user ID of the file to be deleted nor that of the directory
346 .\"O containing it, and the process is not privileged
347 .\"O (Linux: does not have the
348 .\"O .B CAP_FOWNER
349 .\"O capability);
350 .I oldpath
351 ¤Î¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¹¥Æ¥£¥Ã¥­¡¼¡¦¥Ó¥Ã¥È (sticky bit)
352 .RB ( S_ISVTX )
353 ¤¬ÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢
354 ¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬
355 ºï½ü¤·¤è¤¦¤È¤¹¤ë¥Õ¥¡¥¤¥ë¤Î¥æ¡¼¥¶¡¼ ID ¤È
356 ¤½¤Î¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥Ç¥£¥ì¥¯¥È¥ê¤Î¥æ¡¼¥¶¡¼ ID ¤Î¤¤¤º¤ì¤È¤â°ìÃפ»¤º¡¢¤«¤Ä
357 ¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¤ (Linux ¤Ç¤Ï
358 .B CAP_FOWNER
359 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬¤Ê¤¤)¡£
360 .\"O or
361 .\"O .I newpath
362 .\"O is an existing file and the directory containing it has the sticky bit set
363 .\"O and the process's effective user ID is neither the user ID of the file
364 .\"O to be replaced nor that of the directory containing it,
365 .\"O and the process is not privileged
366 .\"O (Linux: does not have the
367 .\"O .B CAP_FOWNER
368 .\"O capability);
369 ¤Þ¤¿¤Ï¡¢
370 .I newpath
371 ¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¤Ç¡¢¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¹¥Æ¥£¥Ã¥­¡¼¥Ó¥Ã¥È¤¬ÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢
372 ¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬
373 ÃÖ¤­´¹¤¨¤è¤¦¤È¤¹¤ë¥Õ¥¡¥¤¥ë¤Î¥æ¡¼¥¶¡¼ ID ¤È
374 ¤½¤Î¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥Ç¥£¥ì¥¯¥È¥ê¤Î¥æ¡¼¥¶¡¼ ID ¤Î¤¤¤º¤ì¤È¤â°ìÃפ»¤º¡¢¤«¤Ä
375 ¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¤ (Linux ¤Ç¤Ï
376 .B CAP_FOWNER
377 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¤)¡£
378 .\"O or the file system containing
379 .\"O .I pathname
380 .\"O does not support renaming of the type requested.
381 ¤Þ¤¿¤Ï
382 .IR oldpath " ¤È " newpath
383 ¤¬Â¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬¡¢Í׵ᤵ¤ì¤¿¼ïÎà¤Î̾Á°¤ÎÊѹ¹¤ò
384 ¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£
385 .TP
386 .B EROFS
387 .\"O The file is on a read-only file system.
388 ¥Õ¥¡¥¤¥ë¤¬Æɤ߹þ¤ßÀìÍÑ (read-only) ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¤¢¤ë¡£
389 .TP
390 .B EXDEV
391 .\"O .IR oldpath " and " newpath
392 .\"O are not on the same mounted file system.
393 .IR oldpath " ¤È " newpath
394 ¤¬Æ±¤¸¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Ê¤¤¡£
395 .\"O (Linux permits a file system to be mounted at multiple points, but
396 .\"O .BR rename ()
397 .\"O does not work across different mount points,
398 .\"O even if the same file system is mounted on both.)
399 (Linux ¤Ï 1 ¤Ä¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤òÊ£¿ô¤Î¥Þ¥¦¥ó¥È°ÌÃÖ¤Ë
400 ¥Þ¥¦¥ó¥È¤¹¤ë¤³¤È¤òµö²Ä¤·¤Æ¤¤¤ë¡£
401 ¤·¤«¤·
402 .BR rename ()
403 ¤Ï¡¢¤¿¤È¤¨Æ±¤¸¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¤¢¤Ã¤Æ¤â¡¢
404 ÊÌ¡¹¤Î¥Þ¥¦¥ó¥È°ÌÃÖ¤ò¸Ù¤¤¤Ç¤ÏÆ°ºî¤·¤Ê¤¤¡£)
405 .\"O .SH "CONFORMING TO"
406 .SH ½àµò
407 4.3BSD, C89, C99, POSIX.1-2001.
408 .\"O .SH BUGS
409 .SH ¥Ð¥°
410 .\"O On NFS file systems, you can not assume that if the operation
411 .\"O failed the file was not renamed.
412 .\"O If the server does the rename operation
413 .\"O and then crashes, the retransmitted RPC which will be processed when the
414 .\"O server is up again causes a failure.
415 .\"O The application is expected to
416 .\"O deal with this.
417 .\"O See
418 .\"O .BR link (2)
419 .\"O for a similar problem.
420 NFS ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¤Ï¡¢Áàºî¤¬¼ºÇÔ¤·¤¿¤«¤é¤È¤¤¤Ã¤Æ¡¢
421 ¥Õ¥¡¥¤¥ë¤Î̾Á°¤¬Êѹ¹¤Ç¤­¤Ê¤«¤Ã¤¿¤È·è¤á¤Æ¤«¤«¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£
422 ¥µ¡¼¥Ð¤¬ rename Áàºî¤ò½ª¤¨¤Æ¤«¤é¥¯¥é¥Ã¥·¥å¤·¤¿¾ì¹ç¡¢
423 ¥µ¡¼¥Ð¤¬ºÆ¤ÓΩ¤Á¾å¤¬¤Ã¤¿¤È¤­¤Ë¡¢
424 ºÆÁ÷¿®¤µ¤ì¤¿ RPC ¤¬½èÍý¤µ¤ì¤ë¤¬¡¢¤³¤ì¤Ï¼ºÇԤȤʤ롣
425 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤ÎÌäÂê¤òÀµ¤·¤¯¼è¤ê°·¤¦¤³¤È¤¬´üÂÔ¤µ¤ì¤Æ¤¤¤ë¡£
426 ƱÍͤÎÌäÂê¤Ë¤Ä¤¤¤Æ
427 .BR link (2)
428 ¤Ë¤â½ñ¤«¤ì¤Æ¤¤¤ë¡£
429 .\"O .SH "SEE ALSO"
430 .SH ´ØÏ¢¹àÌÜ
431 .BR mv (1),
432 .BR chmod (2),
433 .BR link (2),
434 .BR renameat (2),
435 .BR symlink (2),
436 .BR unlink (2),
437 .BR path_resolution (7),
438 .BR symlink (7)