version 1, including all changes.
.
| Rev |
Author |
# |
Line |
| 1 |
perry |
1 |
REMOVE |
| |
|
2 |
!!!REMOVE |
| |
|
3 |
NAME |
| |
|
4 |
SYNOPSIS |
| |
|
5 |
DESCRIPTION |
| |
|
6 |
RETURN VALUE |
| |
|
7 |
ERRORS |
| |
|
8 |
CONFORMING TO |
| |
|
9 |
BUGS |
| |
|
10 |
NOTE |
| |
|
11 |
SEE ALSO |
| |
|
12 |
---- |
| |
|
13 |
!!NAME |
| |
|
14 |
|
| |
|
15 |
|
| |
|
16 |
remove - delete a name and possibly the file it refers to |
| |
|
17 |
!!SYNOPSIS |
| |
|
18 |
|
| |
|
19 |
|
| |
|
20 |
__#include __ |
| |
|
21 |
|
| |
|
22 |
|
| |
|
23 |
__int remove(const char |
| |
|
24 |
*__''pathname''__);__ |
| |
|
25 |
!!DESCRIPTION |
| |
|
26 |
|
| |
|
27 |
|
| |
|
28 |
__remove__ deletes a name from the filesystem. It calls |
| |
|
29 |
''unlink'' for files, and ''rmdir'' for |
| |
|
30 |
directories. |
| |
|
31 |
|
| |
|
32 |
|
| |
|
33 |
If the removed name was the last link to a file and no |
| |
|
34 |
processes have the file open the file is deleted and the |
| |
|
35 |
space it was using is made available for reuse. |
| |
|
36 |
|
| |
|
37 |
|
| |
|
38 |
If the name was the last link to a file but any processes |
| |
|
39 |
still have the file open the file will remain in existence |
| |
|
40 |
until the last file descriptor referring to it is |
| |
|
41 |
closed. |
| |
|
42 |
|
| |
|
43 |
|
| |
|
44 |
If the name referred to a symbolic link the link is |
| |
|
45 |
removed. |
| |
|
46 |
|
| |
|
47 |
|
| |
|
48 |
If the name referred to a socket, fifo or device the name |
| |
|
49 |
for it is removed but processes which have the object open |
| |
|
50 |
may continue to use it. |
| |
|
51 |
!!RETURN VALUE |
| |
|
52 |
|
| |
|
53 |
|
| |
|
54 |
On success, zero is returned. On error, -1 is returned, and |
| |
|
55 |
''errno'' is set appropriately. |
| |
|
56 |
!!ERRORS |
| |
|
57 |
|
| |
|
58 |
|
| |
|
59 |
__EFAULT__ |
| |
|
60 |
|
| |
|
61 |
|
| |
|
62 |
''pathname'' points outside your accessible address |
| |
|
63 |
space. |
| |
|
64 |
|
| |
|
65 |
|
| |
|
66 |
__EACCES__ |
| |
|
67 |
|
| |
|
68 |
|
| |
|
69 |
Write access to the directory containing ''pathname'' is |
| |
|
70 |
not allowed for the process's effective uid, or one of the |
| |
|
71 |
directories in ''pathname'' did not allow search |
| |
|
72 |
(execute) permission. |
| |
|
73 |
|
| |
|
74 |
|
| |
|
75 |
__EPERM__ |
| |
|
76 |
|
| |
|
77 |
|
| |
|
78 |
The directory containing ''pathname'' has the sticky-bit |
| |
|
79 |
(__S_ISVTX__) set and the process's effective uid is |
| |
|
80 |
neither the uid of the file to be deleted nor that of the |
| |
|
81 |
directory containing it. |
| |
|
82 |
|
| |
|
83 |
|
| |
|
84 |
__ENAMETOOLONG__ |
| |
|
85 |
|
| |
|
86 |
|
| |
|
87 |
''pathname'' was too long. |
| |
|
88 |
|
| |
|
89 |
|
| |
|
90 |
__ENOENT__ |
| |
|
91 |
|
| |
|
92 |
|
| |
|
93 |
A directory component in ''pathname'' does not exist or |
| |
|
94 |
is a dangling symbolic link. |
| |
|
95 |
|
| |
|
96 |
|
| |
|
97 |
__ENOTDIR__ |
| |
|
98 |
|
| |
|
99 |
|
| |
|
100 |
A component used as a directory in ''pathname'' is not, |
| |
|
101 |
in fact, a directory. |
| |
|
102 |
|
| |
|
103 |
|
| |
|
104 |
__ENOMEM__ |
| |
|
105 |
|
| |
|
106 |
|
| |
|
107 |
Insufficient kernel memory was available. |
| |
|
108 |
|
| |
|
109 |
|
| |
|
110 |
__EROFS__ |
| |
|
111 |
|
| |
|
112 |
|
| |
|
113 |
''pathname'' refers to a file on a read-only |
| |
|
114 |
filesystem. |
| |
|
115 |
!!CONFORMING TO |
| |
|
116 |
|
| |
|
117 |
|
| |
|
118 |
ANSI C, SVID, AT |
| |
|
119 |
!!BUGS |
| |
|
120 |
|
| |
|
121 |
|
| |
|
122 |
Infelicities in the protocol underlying NFS can cause the |
| |
|
123 |
unexpected disappearance of files which are still being |
| |
|
124 |
used. |
| |
|
125 |
!!NOTE |
| |
|
126 |
|
| |
|
127 |
|
| |
|
128 |
Under libc4 and libc5, __remove__ was an alias for unlink |
| |
|
129 |
(and hence would not remove directories). |
| |
|
130 |
!!SEE ALSO |
| |
|
131 |
|
| |
|
132 |
|
| |
|
133 |
unlink(2), rename(2), open(2), |
| |
|
134 |
rmdir(2), mknod(2), mkfifo(3), |
| |
|
135 |
link(2), rm(1), unlink(8) |
| |
|
136 |
---- |