Research V4 development
[unix-history] / man / man2 / unlink.2
CommitLineData
6e0e2adb
KT
1.th UNLINK II 8/5/73
2.sh NAME
3unlink \*- remove directory entry
4.sh SYNOPSIS
5(unlink = 10.)
6.br
7.bt B
8sys unlink; name
9.s3
10unlink(name)
11.br
12char *name;
13.ft R
14.sh DESCRIPTION
15.it Name
16points to a null-terminated string.
17.it Unlink
18removes the entry for the file pointed to by
19.it name
20from its directory.
21If this entry was the last link to the file,
22the contents of the file are freed and the file is destroyed.
23If, however, the file was open in any process, the actual
24destruction is delayed until it is closed, even though
25the directory entry has disappeared.
26.sh "SEE ALSO"
27rm(I), rmdir(I), link(II)
28.sh DIAGNOSTICS
29The error bit
30(c-bit) is set to indicate that the file does not
31exist or that its directory cannot be written.
32Write permission is not required on the file itself.
33It is also illegal to unlink a directory
34(except for the super-user).
35From C, a \*-1 return indicates an error.