.so header
.tl /UNLINK(3S)/Kreider OS-9 C Library/UNLINK(3S)/
.sh NAME
.bb
unlink - remove a directory entry
.eb
.sh SYNOPSIS
.bb
unlink(fname)
char *fname;
.eb
.sh DESCRIPTION
.db \fBUNLINK deletes the directory entry whose name is pointed to by\f
.ul
fname.
If the entry was the last link to the file, then the file itself is deleted
and the disc space occupied made available for re-use. If, however, the file
is open or in any active task, the deletion of the actual file is delayed
until the file is closed.
.ed
.sh DIAGNOSTICS
.db
Zero is returned from a successful call, -1 if the file does not exist, if
its directory is write-protected, the pathname cannot be searched or if the
file itself is a non-empty directory or a device.
.ed
.sh SEE ALSO
.bb
unlinkx(), OS-9 "kill" command
.eb
