OSDN Git Service

38e06d6ab0696a5d79cd7398a4b68e79922e02bd
[linuxjm/LDP_man-pages.git] / release / man3 / remove.3
1 .\" This file is derived from unlink.2, which has the following copyright:
2 .\"
3 .\" This manpage is Copyright (C) 1992 Drew Eckhardt;
4 .\"             and Copyright (C) 1993 Ian Jackson.
5 .\"
6 .\" Edited into remove.3 shape by:
7 .\" Graeme W. Wilford (G.Wilford@ee.surrey.ac.uk) on 13th July 1994
8 .\"
9 .\" %%%LICENSE_START(VERBATIM)
10 .\" Permission is granted to make and distribute verbatim copies of this
11 .\" manual provided the copyright notice and this permission notice are
12 .\" preserved on all copies.
13 .\"
14 .\" Permission is granted to copy and distribute modified versions of this
15 .\" manual under the conditions for verbatim copying, provided that the
16 .\" entire resulting derived work is distributed under the terms of a
17 .\" permission notice identical to this one.
18 .\"
19 .\" Since the Linux kernel and libraries are constantly changing, this
20 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
21 .\" responsibility for errors or omissions, or for damages resulting from
22 .\" the use of the information contained herein.  The author(s) may not
23 .\" have taken the same level of care in the production of this manual,
24 .\" which is licensed free of charge, as they might when working
25 .\" professionally.
26 .\"
27 .\" Formatted or processed versions of this manual, if unaccompanied by
28 .\" the source, must acknowledge the copyright and authors of this work.
29 .\" %%%LICENSE_END
30 .\"
31 .\"*******************************************************************
32 .\"
33 .\" This file was generated with po4a. Translate the source file.
34 .\"
35 .\"*******************************************************************
36 .TH REMOVE 3 2008\-12\-03 GNU "Linux Programmer's Manual"
37 .SH 名前
38 remove \- ファイルやディレクトリを削除する
39 .SH 書式
40 \fB#include <stdio.h>\fP
41 .sp
42 \fBint remove(const char *\fP\fIpathname\fP\fB);\fP
43 .SH 説明
44 \fBremove\fP()  はファイルシステムからファイル名を削除する。 ファイルに対しては \fBunlink\fP(2)  を、ディレクトリに対しては
45 \fBrmdir\fP(2)  を呼び出す。
46
47 もしその名前が ファイルへの最後のリンクで、かつ、どのプロセスもそのファイルを 開いていないなら、ファイルも削除する。ファイルの占めていた
48 領域は他で使うことができるようになる。
49
50 名前がファイルへの最後のリンクであっても、どこかのプロセスが そのファイルを開いているなら、ファイルの最後のファイル記述子 (file
51 descriptor) が閉じられるまでファイルは存在し続ける。
52
53 名前が指しているのがシンボリックリンクなら、そのリンクを削除する。
54
55 名前が指しているのがソケット、FIFO、デバイスの場合、名前は削除されるが、 そのソケットなどを開いているプロセスはそのまま使い続けることができる。
56 .SH 返り値
57 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
58 .SH エラー
59 発生するエラーは \fBunlink\fP(2)  および \fBrmdir\fP(2)  と同じものである。
60 .SH 準拠
61 C89, C99, 4.3BSD, POSIX.1\-2001.
62 .SH 注意
63 libc4 と libc5 においては、 \fBremove\fP()  は \fBunlink\fP(2)  の別名であった
64 (従ってディレクトリを削除できなかった)。
65 .SH バグ
66 NFS プロトコルに内在する問題により、まだ使用中のファイルが想定外に消えてしまうことがありえる。
67 .SH 関連項目
68 \fBrm\fP(1), \fBunlink\fP(1), \fBlink\fP(2), \fBmknod\fP(2), \fBopen\fP(2), \fBrename\fP(2),
69 \fBrmdir\fP(2), \fBunlink\fP(2), \fBmkfifo\fP(3), \fBsymlink\fP(7)
70 .SH この文書について
71 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
72 である。プロジェクトの説明とバグ報告に関する情報は
73 http://www.kernel.org/doc/man\-pages/ に書かれている。