DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

rmdir(S-osr5)


rmdir -- remove a directory

Syntax

cc ... -lc

int rmdir (path)
char *path;

Description

rmdir removes the directory named by the pathname pointed to by path. The directory must not have any entries other than ``.'' and ``..''.

A directory is not removed when all of the following conditions are true:

Return value

Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.

Diagnostics

The rmdir function will fail if:

[EACCES]

[EBUSY]
The directory to be removed is the mount point for a mounted filesystem.

[EEXIST]
The directory contains entries other than those for ``.'' and``..''.

[EFAULT]
path points outside the process's allocated address space.

[EINVAL]

[EIO]
An I/O error occurred while accessing the filesystem.

[EMULTIHOP]
Components of path require hopping to multiple remote machines.

[ENOENT]
The named directory does not exist.

[ENOLINK]
path points to a remote machine, and the link to that machine is no longer active.

[ENOTDIR]
A component of the path prefix is not a directory.

[EROFS]
The directory entry to be removed is part of a read-only filesystem.

See also

mkdir(C), mkdir(S-osr5), rmdir(C), rm(C)

Standards conformance

rmdir is conformant with:

X/Open Portability Guide, Issue 3, 1989 ;
IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1) ; and NIST FIPS 151-1 .


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005