rmdir() Remove a Directory
#include <direct.h> Required for declarations only
int rmdir(pathname);
char *pathname; Name of Path name to be removed
rmdir() deletes the directory specified by 'pathname'. All files and
subdirectories must first be deleted from the directory, and it
cannot be the current working directory or the root directory.
Returns: A zero if the directory was successfully deleted, or -1
on error. -1 causes 'errno' (defined in <stdlib.h>) to be
set to:
EACCES Path name is not a directory; or directory
is not empty; or the directory is the
current directory or the root directory.
ENOENT Path name not found.
-------------------------------- Example ---------------------------------
The following statement removes a directory and prints a message
#include <direct.h>
int result1;
main()
{
if ((result1 = rmdir("/tstmkd")) < 0)
printf("error removing directory");
else
printf("tstmkd removed");
}
Seealso:
This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster