RMDIR(2-POSIX) RISC/os Reference Manual RMDIR(2-POSIX)
NAME
rmdir - remove a directory
SYNOPSIS
int rmdir (path)
char *path;
DESCRIPTION
rmdir removes the directory named by the path name pointed
to by path. The directory must not have any entries other
than "." and "..".
If the directory's link count becomes zero and no process
has the directory open, the space occupied by the directory
is freed and the directory is no longer accessible. If one
or more processes have the directory open when the last link
is removed, the dot and dot-dot entries, if present, are
removed before rmdir returns and no new entries may be
created in the directory, but the directory is not removed
until all references to the directory have been closed.
Upon successful completion, rmdir marks for update the
st_ctime and st_mtime fields of the parent directory.
ERRORS
The named directory is removed unless one or more of the
following are true:
[EINVAL] The directory to be removed is ".".
[ENOTEMPTY] The directory contains entries other
than those for "." and "..".
[ENOTDIR] A component of the path prefix is not a
directory.
[ENOENT] The named directory does not exist, or
path points to an empty string.
[EACCES] Search permission is denied for a com-
ponent of the path prefix, or write per-
mission is denied on the directory con-
taining the directory to be removed.
[EBUSY] The directory to be removed is the mount
point for a mounted file system.
[EROFS] The directory entry to be removed is
part of a read-only file system.
[EFAULT] path points outside the process's allo-
cated address space.
Printed 1/15/91 Page 1
RMDIR(2-POSIX) RISC/os Reference Manual RMDIR(2-POSIX)
[EIO] An I/O error occurred while accessing
the file system.
[ENAMETOOLONG] The length of path exceeds {PATH_MAX},
or a pathname component is longer than
{NAME_MAX} while {_POSIX_NO_TRUNC} is in
effect.
DIAGNOSTICS
Upon successful completion, a value of 0 is returned. Oth-
erwise, a value of -1 is returned and errno is set to indi-
cate the error.
SEE ALSO
mkdir(2).
rmdir(1), rm(1), and mkdir(1) in the User's Reference
Manual.
Page 2 Printed 1/15/91