RMDIR(DOS) XENIX System V RMDIR(DOS)
Name
rmdir - Deletes a directory.
Syntax
#include <direct.h>
int rmdir (pathname);
char *pathname;
Description
The rmdir function deletes the directory specified by
pathname. The directory must be empty, and it must not be
the current working directory or the root directory.
Return Value
rmdir returns the value 0 if the directory is successfully
deleted. A return value of -1 indicates an error, and errno
is set to one of the following values:
Value Meaning
EACCES The given pathname is not a
directory, the directory is not
empty, or the directory is the
current working directory or root
directory.
ENOENT Pathname not found.
See Also
chdir(S), mkdir(DOS)
Page 1 (printed 8/7/87)
RMDIR(DOS) XENIX System V RMDIR(DOS)
Example
#include <direct.h>
int result1, result2;
/* The following statements delete two directories: ** one
at the root, and one in the current working ** directory.
*/
result1 = rmdir ("/data"); result2 = rmdir ("data");
Notes
This call must be compiled with the -dos flag.
Page 2 (printed 8/7/87)