Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ unlink(2) — A/UX 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

close(2)

link(2)

open(2)

rmdir(2)

rm(1)

rmdir(1)




unlink(2) unlink(2)
NAME unlink - remove directory entry SYNOPSIS int unlink(path) char *path; DESCRIPTION unlink removes the directory entry named by the pathname referenced by path. When all links to a file have been removed and no process has the file open, the space occupied by the file is freed and the file ceases to exist. If one or more processes have the file open when the last link is removed, the removal is postponed until all references to the file have been closed. STATUS MESSAGES AND VALUES Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. The named file is unlinked unless one or more of the following is true: ENOTDIR A component of the path prefix is not a directory. EPERM path is a directory and the effective user ID is not root. ENAMETOOLONG A component of a pathname exceeded NAME_MAX characters, or an entire pathname exceeded PATH_MAX. ELOOP Too many symbolic links were encountered in translating a pathname. ENOENT The named file does not exist. EACCES Search permission is denied for a component of the path prefix. EACCES Write permission is denied on the directory containing the link to be removed. EBUSY January 1992 1



unlink(2) unlink(2)
The entry to be unlinked is the mount point for a mounted file system. ETXTBSY The entry to be unlinked is the last link to a pure procedure (shared text) file that is being executed. Note: If you are running an NFS system and you are accessing a shared binary remotely, it is possible that you will not get this errno. EROFS The directory entry to be unlinked is part of a read- only file system. EFAULT path points outside the process's allocated address space. ENOTEMPTY path is a directory that contains other files besides ``.'' and ``..'' files. SEE ALSO close(2), link(2), open(2), rmdir(2) rm(1), rmdir(1) in A/UX Command Reference 2 January 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026