]>
Commit | Line | Data |
---|---|---|
fea681da MK |
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 <faith@cs.unc.edu> | |
27 | .\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com> | |
305a0578 | 28 | .\" Modified 2004-06-23 by Michael Kerrisk <mtk-manpages@gmx.net> |
fea681da MK |
29 | .\" |
30 | .TH RMDIR 2 2004-06-23 "Linux 2.6.7" "Linux Programmer's Manual" | |
31 | .SH NAME | |
32 | rmdir \- delete a directory | |
33 | .SH SYNOPSIS | |
34 | .B #include <unistd.h> | |
35 | .sp | |
36 | .BI "int rmdir(const char *" pathname ); | |
37 | .SH DESCRIPTION | |
e511ffb6 | 38 | .BR rmdir () |
fea681da MK |
39 | deletes a directory, which must be empty. |
40 | .SH "RETURN VALUE" | |
41 | On success, zero is returned. On error, \-1 is returned, and | |
42 | .I errno | |
43 | is set appropriately. | |
44 | .SH ERRORS | |
45 | .TP | |
46 | .B EACCES | |
47 | Write access to the directory containing | |
48 | .I pathname | |
49 | was not allowed, or one of the directories in the path prefix of | |
50 | .IR pathname | |
51 | did not allow search permission. | |
52 | (See also | |
53 | .BR path_resolution (2). | |
54 | .TP | |
55 | .B EBUSY | |
56 | .I pathname | |
57 | is the current working directory or root directory of some process. | |
58 | .TP | |
59 | .B EFAULT | |
60 | .IR pathname " points outside your accessible address space." | |
61 | .TP | |
62 | .B EINVAL | |
63 | .I pathname | |
64 | has | |
65 | .B . | |
66 | as last component. | |
67 | .TP | |
68 | .B ELOOP | |
69 | Too many symbolic links were encountered in resolving | |
70 | .IR pathname . | |
71 | .TP | |
72 | .B ENAMETOOLONG | |
73 | .IR pathname " was too long." | |
74 | .TP | |
75 | .B ENOENT | |
76 | A directory component in | |
77 | .I pathname | |
78 | does not exist or is a dangling symbolic link. | |
79 | .TP | |
80 | .B ENOMEM | |
81 | Insufficient kernel memory was available. | |
82 | .TP | |
83 | .B ENOTDIR | |
84 | .IR pathname , | |
85 | or a component used as a directory in | |
86 | .IR pathname , | |
87 | is not, in fact, a directory. | |
88 | .TP | |
89 | .B ENOTEMPTY | |
90 | .I pathname | |
91 | contains entries other than | |
92 | .BR . " and " .. " ." | |
93 | .TP | |
94 | .B EPERM | |
95 | The directory containing | |
96 | .I pathname | |
97 | has the sticky bit | |
98 | .RB ( S_ISVTX ) | |
99 | set and the process's effective user ID is neither the user ID of the file to | |
100 | be deleted nor that of the directory containing it, and the process is not | |
101 | privileged (Linux: does not have the | |
102 | .B CAP_FOWNER | |
103 | capability). | |
104 | .TP | |
105 | .B EPERM | |
106 | The filesystem containing | |
107 | .IR pathname | |
108 | does not support the removal of directories. | |
109 | .TP | |
110 | .B EROFS | |
111 | .I pathname | |
112 | refers to a file on a read-only filesystem. | |
113 | .SH "CONFORMING TO" | |
b14d4aa5 | 114 | SVr4, SVID, POSIX, 4.3BSD |
fea681da MK |
115 | .SH BUGS |
116 | Infelicities in the protocol underlying NFS can cause the unexpected | |
117 | disappearance of directories which are still being used. | |
118 | .SH "SEE ALSO" | |
119 | .BR rm (1), | |
120 | .BR rmdir (1), | |
121 | .BR chdir (2), | |
122 | .BR chmod (2), | |
123 | .BR mkdir (2), | |
124 | .BR rename (2), | |
125 | .BR unlink (2) |