Chapter Contents

Previous

Next
rmdir

rmdir



Remove Directory

Portability: POSIX.1 conforming, UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
EXAMPLE
RELATED FUNCTIONS
SEE ALSO


SYNOPSIS

#include <unistd.h>

int rmdir(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


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.