OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man3 / remove.3
1 .\" This file is derived from unlink.2, which has the following copyright:
2 .\"
3 .\" --snip--
4 .\" This manpage is Copyright (C) 1992 Drew Eckhardt;
5 .\"                               1993 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 .\" --snip--
27 .\"
28 .\" Edited into remove.3 shape by:
29 .\" Graeme W. Wilford (G.Wilford@ee.surrey.ac.uk) on 13th July 1994
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)