Commit | Line | Data |
---|---|---|
cb67878b TL |
1 | .TH UNLINK 2 |
2 | .SH NAME | |
3 | unlink \- remove directory entry | |
4 | .SH SYNOPSIS | |
5 | .B unlink(name) | |
6 | .br | |
7 | .B char *name; | |
8 | .SH DESCRIPTION | |
9 | .I Name | |
10 | points to a null-terminated string. | |
11 | .I Unlink | |
12 | removes the entry for the file pointed to by | |
13 | .I name | |
14 | from its directory. | |
15 | If this entry was the last link to the file, | |
16 | the contents of the file are freed and the file is destroyed. | |
17 | If, however, the file was open in any process, the actual | |
18 | destruction is delayed until it is closed, even though | |
19 | the directory entry has disappeared. | |
20 | .SH "SEE ALSO" | |
21 | rm(1), link(2) | |
22 | .SH DIAGNOSTICS | |
23 | Zero is normally returned; | |
24 | \-1 indicates that the file does not | |
25 | exist, that its directory cannot be written, | |
26 | or that the file contains pure procedure text | |
27 | that is currently in use. | |
28 | Write permission is not required on the file itself. | |
29 | It is also illegal to unlink a directory | |
30 | (except for the super-user). | |
31 | .SH "ASSEMBLER (PDP-11)" | |
32 | (unlink = 10.) | |
33 | .br | |
34 | .B sys unlink; name |