RMDIR(2,L) AIX Technical Reference RMDIR(2,L)
-------------------------------------------------------------------------------
rmdir
PURPOSE
Removes a directory file.
SYNTAX
rmdir (path)
char *path;
DESCRIPTION
The rmdir system call removes the directory specified by the path parameter.
The directory you specify must be empty and you must have write access to it.
If the parent directory of path has the sticky attribute bit set, the calling
process must have an effective user ID equal to:
o the owner ID of path, or to
o the owner ID of the parent directory of path.
RETURN VALUE
Upon successful completion, the rmdir system call returns a value of 0. If the
rmdir system call fails, a value of -1 is returned, and errno is set to
indicate the error. It is an error to apply rmdir to a symbolic link.
ERROR CONDITIONS
The rmdir system call fails and the directory is not deleted if one or more of
the following are true:
EBUSY The directory is in use as either the mount point for a file system
or the current directory of the process that issued the rmdir.
EEXIST The directory is not empty.
ENOTDIR A component of the path is not a directory.
ENOENT The named file does not exist.
EACCES A component of the path denies search permission or write permission
is denied on the directory containing the link to be removed.
EROFS The named file resides on a read-only file system.
Processed November 7, 1990 RMDIR(2,L) 1
RMDIR(2,L) AIX Technical Reference RMDIR(2,L)
EFAULT path points outside of the process's allocated address space.
ESTALE The process's root or current directory is located in an NFS virtual
file system that has been unmounted.
ENAMETOOLONG
A component of the path parameter exceeded NAME_MAX characters or the
entire path parameter exceeded PATH_MAX characters.
EISDIR A hidden directory was named, components within hidden directories
must be explicitly named.
ENOENT A symbolic link was named in the path prefix, but the file to which
it refers does not exist.
ELOOP A loop of symbolic links was detected.
ENFILE The system inode table is full.
EPERM The file named by the path parameter is in a directory with the
sticky attribute bit set, and the effective user ID of the calling
process is not equal to the owner of the file or of the parent
directory.
If the Transparent Computing Facility is installed on your system, rmdir can
also fail if one or more of the following are true:
ELOOP An rmdir was attempted on a symbolic link in a system-type replicated
file system.
ESITEDN1 path cannot be accessed because a site went down.
ESITEDN2 The operation was terminated because a site failed.
ENOSTORE path is a name relative to the working directory, but no site which
stores this directory is currently up.
ENOSTORE A component of path is replicated but not stored on any site which is
currently up.
EROFS Write access is requested for a file on a replicated file system in
which the primary copy is unavailable.
EINTR A signal was caught during the system call.
RELATED INFORMATION
In this book: "chmod, fchmod," "mkdir," "mknod, mknodx, mkfifo," "rename,"
and "umask."
Processed November 7, 1990 RMDIR(2,L) 2