|
unlink()
removes the directory entry named by the pathname pointed to by
path and decrements the link count of the file referred to by that entry.
If this entry was the last link to the file,
and no process has the file open, then
all resources associated with the file are reclaimed.
If, however, the file was open in any process, the actual
resource reclamation is delayed until it is closed,
even though the directory entry has disappeared.
If
path refers to a directory,
the effective
user-ID
of the calling process must be super-user.
Upon successful completion,
unlink()
marks for update the
st_ctime
and
st_mtime
fields of the parent directory.
Also, if the file's link count is not zero, the
st_ctime
field of the file is marked for update.
|