579
|
1 <!--
|
|
2 Too much inspiration from UNIX version 7 manuals, as you can see:
|
|
3 DESCRIPTION
|
|
4 Unlink removes the entry for the file pointed to by name from
|
|
5 its directory. If this entry was the last link to the file,
|
|
6 the contents of the file are freed and the file is destroyed.
|
|
7 If, however, the file was open in any process, the actual
|
|
8 destruction is delayed until it is closed, even though the
|
|
9 directory entry has disappeared.
|
|
10
|
|
11 SEE ALSO
|
|
12 rm(1), link(2)
|
|
13
|
|
14 DIAGNOSTICS
|
|
15 Zero is normally returned; -1 indicates that the file does not exist,
|
|
16 that its directory cannot be written, or that the file contains pure
|
|
17 procedure text that is currently in use. Write permission is not
|
|
18 required on the file itself. It is also illegal to unlink a directory
|
|
19 (except for the super-user).
|
|
20
|
|
21 -->
|
466
|
22 <refentry id="unlink">
|
|
23 <refnamediv>
|
468
|
24 <refname>Unlink</refname>
|
|
25 <refpurpose>remove directory entry</refpurpose>
|
466
|
26 </refnamediv>
|
|
27
|
|
28 <refsynopsisdiv>
|
|
29 <funcsynopsis>
|
|
30 <funcprototype>
|
|
31 <funcdef><function>unlink</function></funcdef>
|
579
|
32 <paramdef>char *<parameter>fname</parameter></paramdef>
|
466
|
33 </funcprototype>
|
|
34 </funcsynopsis>
|
|
35
|
|
36 </refsynopsisdiv>
|
|
37
|
546
|
38 <refsect1><title>Assembler Equivalent</title>
|
|
39 <para>
|
|
40 os9 I$DELETE
|
|
41 </para>
|
|
42 </refsect1>
|
|
43
|
466
|
44 <refsect1><title>Description</title>
|
|
45 <para>
|
579
|
46 Unlink deletes the directory entry whose name is pointed to by
|
|
47 "fname". If the entry was the last link to the file, the file
|
|
48 itself is deleted and the disc space occupied made available
|
|
49 for re-use. If, however the file is open, in any active task,
|
|
50 the deletion of the actual file is delayed until the file is
|
|
51 closed.
|
466
|
52 </para>
|
|
53 </refsect1>
|
552
|
54
|
|
55 <refsect1><title>Diagnostics</title>
|
|
56 <para>
|
|
57 Zero is returned from a successful call, -1 if the file does
|
|
58 not exist, if its directory is write-protected, or cannot be
|
|
59 searched, if the file is a non-empty directory or a device.
|
|
60 </para>
|
|
61 </refsect1>
|
|
62
|
|
63 <refsect1><title>See Also</title>
|
|
64 <para>
|
|
65 OS-9 command "kill"
|
579
|
66 <!-- The original manual referenced link() here, but no such system call exists. -->
|
552
|
67 </para>
|
|
68 </refsect1>
|
466
|
69 </refentry>
|