UNLINK(2) UNIX Programmer's Manual UNLINK(2) NAME unlink - remove directory entry SYNOPSIS unlink(name) char *name; DESCRIPTION _U_n_l_i_n_k removes the entry for the file pointed to by _n_a_m_e from its directory. If this entry was the last link to the file, the contents of the file are freed and the file is destroyed. If, however, the file was open in any process, the actual destruction is delayed until it is closed, even though the directory entry has disappeared. ERRORS _U_n_l_i_n_k will succeed unless: [EINVAL] The path name contains a non-ASCII byte. [ENOTDIR] A component of the path prefix is not a directory. [ENOENT] The named file does not exist. [EACCES] Search permission is denied for a com- ponent of the path prefix. [EACCES] Write permission is denied on the direc- tory containing the link to be removed. [EPERM] The named file is a directory and the process's effective user ID is not the super-user. [EBUSY] The entry to be unlinked is the mount point for a mounted file system. [EROFS] The named file resides on a read-only file system. [EFAULT] _N_a_m_e points to an address outside the process's allocated address space. [ELOOP] Too many symbolic links were encountered in translating the path name. SEE ALSO rm(1), link(2) ASSEMBLER (unlink = 10.) Printed 5/23/83 1 UNLINK(2) UNIX Programmer's Manual UNLINK(2) sys unlink; name Printed 5/23/83 2