rmdir -- Remove Directory

SYNOPSIS

 #include <unistd.h>

 int rmdir(const char *pathname);
 

DESCRIPTION

rmdir removes an empty directory named by pathname. The rmdir function deletes the directory itself if no process has the directory open, and the space that was occupied by the directory is freed. pathname is removed even if it is the working directory of a process. If a process has the directory open, unlink removes the links, but the directory is not removed until the last process has closed it. You cannot create new files in the directory after the last link is removed.

RETURN VALUE

rmdir returns 0 if it is successful and - 1 if it is not successful.

EXAMPLE

See the example for rewinddir.

RELATED FUNCTIONS

mkdir

SEE ALSO


Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.