OSDN Git Service

638466438640757b6228df35bd8140226c4ee707
[linuxjm/LDP_man-pages.git] / draft / man2 / symlink.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" This manpage is Copyright (C) 1992 Drew Eckhardt;
4 .\"                               1993 Michael Haardt, Ian Jackson.
5 .\"
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\"
26 .\" Modified 1993-07-24 by Rik Faith
27 .\" Modified 1996-04-26 by Nick Duffek <nsd@bbc.com>
28 .\" Modified 1996-11-06 by Eric S. Raymond <esr@thyrsus.com>
29 .\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
30 .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
31 .\"
32 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
33 .\"         all rights reserved.
34 .\" Translated Fri Dec 12 00:32:12 JST 1997
35 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
36 .\" Updated & Modifed Sat Feb 12 11:20:18 JST 2005
37 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
38 .\"
39 .\"WORD:        symbolic link           シンボリック・リンク
40 .\"WORD:        directory               ディレクトリ
41 .\"WORD:        soft link               ソフト・リンク
42 .\"WORD:        hard link               ハード・リンク
43 .\"WORD:        dangling link           壊れたリンク
44 .\"WORD:        sticky bit              スティッキー・ビット
45 .\"WORD:        ownership               所有権
46 .\"WORD:        file system             ファイル・システム
47 .\"WORD:        effective uid           実効ユーザーID
48 .\"WORD:        kernel                  カーネル
49 .\"WORD:        entry                   エントリ
50 .\"
51 .TH SYMLINK 2 2010-09-20 "Linux" "Linux Programmer's Manual"
52 .\"O .SH NAME
53 .SH 名前
54 .\"O symlink \- make a new name for a file
55 symlink \- ファイルに新しい名前を付ける
56 .\"O .SH SYNOPSIS
57 .SH 書式
58 .B #include <unistd.h>
59 .sp
60 .BI "int symlink(const char *" oldpath ", const char *" newpath );
61 .sp
62 .in -4n
63 .\"O Feature Test Macro Requirements for glibc (see
64 .\"O .BR feature_test_macros (7)):
65 glibc 向けの機能検査マクロの要件
66 .RB ( feature_test_macros (7)
67 参照):
68 .in
69 .sp
70 .ad l
71 .BR symlink ():
72 .RS 4
73 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
74 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE\ >=\ 200112L
75 .RE
76 .ad b
77 .\"O .SH DESCRIPTION
78 .SH 説明
79 .\"O .BR symlink ()
80 .\"O creates a symbolic link named
81 .\"O .I newpath
82 .\"O which contains the string
83 .\"O .IR oldpath .
84 .BR symlink ()
85
86 .I oldpath
87 という文字列をファイルの内容として持つ
88 .I newpath
89 というシンボリック・リンク (symbolic link) を作成する。
90
91 .\"O Symbolic links are interpreted at run time as if the contents of the
92 .\"O link had been substituted into the path being followed to find a file or
93 .\"O directory.
94 シンボリック・リンクは実行時に解釈され、
95 リンクの内容でパスを置き換えて、そのパスを辿ることで、
96 ファイルやディレクトリに到達する。
97
98 .\"O Symbolic links may contain
99 .\"O .I ..
100 .\"O path components, which (if used at the start of the link) refer to the
101 .\"O parent directories of that in which the link resides.
102 シンボリック・リンクはパスの部分に
103 .I ..
104 を含むかもしれない。これは (もしリンクの最初に使用された場合は) リンクの
105 存在するディレクトリの親ディレクトリが参照される。
106
107 .\"O A symbolic link (also known as a soft link) may point to an existing
108 .\"O file or to a nonexistent one; the latter case is known as a dangling
109 .\"O link.
110 シンボリック・リンクは (ソフト・リンク (soft link) とも呼ばれ)
111 存在するファイルを指しているかもしれないし、
112 存在しないファイルを指しているかもしれない;
113 後者の場合は壊れたリンク (dangling link) とも呼ばれる。
114
115 .\"O The permissions of a symbolic link are irrelevant; the ownership is
116 .\"O ignored when following the link, but is checked when removal or
117 .\"O renaming of the link is requested and the link is in a directory with
118 .\"O the sticky bit
119 .\"O .RB ( S_ISVTX )
120 .\"O set.
121 シンボリック・リンクの許可 (permission) は無意味である;
122 リンクを追跡する場合には所有権 (ownership) は無視される。
123 ただし、リンクの削除や名前の変更が要求され、かつリンクが存在する
124 ディレクトリにスティッキー・ビット (sticky bit)
125 .RB ( S_ISVTX )
126 が設定されている場合には、所有権のチェックが行われる。
127
128 .\"O If
129 .\"O .I newpath
130 .\"O exists it will
131 .\"O .I not
132 .\"O be overwritten.
133 .I newpath
134 が既に存在する場合には上書きは\fBされない\fR。
135 .\"O .SH "RETURN VALUE"
136 .SH 返り値
137 .\"O On success, zero is returned.
138 .\"O On error, \-1 is returned, and
139 .\"O .I errno
140 .\"O is set appropriately.
141 成功した場合には 0 を返す。エラーの場合には \-1 を返し、
142 .I errno
143 が適切に設定される。
144 .\"O .SH ERRORS
145 .SH エラー
146 .TP
147 .B EACCES
148 .\"O Write access to the directory containing
149 .\"O .I newpath
150 .\"O is denied, or one of the directories in the path prefix of
151 .\"O .I newpath
152 .\"O did not allow search permission.
153 .\"O (See also
154 .\"O .BR path_resolution (7).)
155 .I newpath
156 を含んでいるディレクトリへの書き込みが拒否されたか、
157 .I newpath
158 に含まれているディレクトリのどれかに検索許可が与えられていない
159 .RB ( path_resolution (7)
160 も参照すること)。
161 .TP
162 .B EEXIST
163 .\"O .I newpath
164 .\"O already exists.
165 .I newpath
166 が既に存在している。
167 .TP
168 .B EFAULT
169 .\"O .IR oldpath " or " newpath " points outside your accessible address space."
170 .IR oldpath " や " newpath " がアクセス可能なアドレス空間の外を指している。"
171 .TP
172 .B EIO
173 .\"O An I/O error occurred.
174 I/O エラーが発生した。
175 .TP
176 .B ELOOP
177 .\"O Too many symbolic links were encountered in resolving
178 .\"O .IR newpath .
179 .I newpath
180 を解決する際に遭遇したシンボリック・リンクが多過ぎる。
181 .TP
182 .B ENAMETOOLONG
183 .\"O .IR oldpath " or " newpath " was too long."
184 .IR oldpath " または " newpath " が長過ぎる。"
185 .TP
186 .B ENOENT
187 .\"O A directory component in
188 .\"O .I newpath
189 .\"O does not exist or is a dangling symbolic link, or
190 .\"O .I oldpath
191 .\"O is the empty string.
192 .I newpath
193 に含まれるディレクトリ部分が存在しないか、壊れたリンクであるか、
194 .I oldpath
195 が空文字列である。
196 .TP
197 .B ENOMEM
198 .\"O Insufficient kernel memory was available.
199 十分なカーネル (kernel) のメモリーがない。
200 .TP
201 .B ENOSPC
202 .\"O The device containing the file has no room for the new directory
203 .\"O entry.
204 ファイルが含まれているデバイスに新しいディレクトリ・エントリ
205 (directory entry) を作成するだけの十分な容量がない。
206 .TP
207 .B ENOTDIR
208 .\"O A component used as a directory in
209 .\"O .I newpath
210 .\"O is not, in fact, a directory.
211 .I newpath
212 に含まれるディレクトリ部分が、実際には、ディレクトリではない。
213 .TP
214 .B EPERM
215 .\"O The file system containing
216 .\"O .I newpath
217 .\"O does not support the creation of symbolic links.
218 .I newpath
219 を含んでいるファイル・システム (file system) が
220 シンボリック・リンクの作成をサポートしていない。
221 .TP
222 .B EROFS
223 .\"O .I newpath
224 .\"O is on a read-only file system.
225 .I newpath
226 が読み込み専用のファイル・システムに存在している。
227 .\"O .SH "CONFORMING TO"
228 .SH 準拠
229 SVr4, 4.3BSD, POSIX.1-2001.
230 .\"O .\" SVr4 documents additional error codes EDQUOT and ENOSYS.
231 .\" SVr4 には他に EDQUOT, ENOSYS エラーについての記述がある。
232 .\"O .\" See
233 .\"O .\" .BR open (2)
234 .\"O .\" re multiple files with the same name, and NFS.
235 .\" .BR open (2)
236 .\" を見て、同じ名前の重複と NFS について参照すること。
237 .\"O .SH NOTES
238 .SH 注意
239 .\"O No checking of
240 .\"O .I oldpath
241 .\"O is done.
242 .I oldpath
243 についてのチェックは行なわれない。
244
245 .\"O Deleting the name referred to by a symlink will actually delete the
246 .\"O file (unless it also has other hard links).
247 .\"O If this behavior is not desired, use
248 .\"O .BR link (2).
249 symlink によって参照される名前を削除すると (それが他にハード・リンク
250 (hard link) を持たなければ) 実際にファイルが削除される。
251 この動作が望んだものでない場合は、
252 .BR link (2)
253 を使用すること。
254 .\"O .SH "SEE ALSO"
255 .SH 関連項目
256 .BR ln (1),
257 .BR lchown (2),
258 .BR link (2),
259 .BR lstat (2),
260 .BR open (2),
261 .BR readlink (2),
262 .BR rename (2),
263 .BR symlinkat (2),
264 .BR unlink (2),
265 .BR path_resolution (7),
266 .BR symlink (7)