函数名: rmdir
功 能: 删除DOS文件目录
用 法: #include <dir.h>
int rmdir(char *stream);
程序例:
#include <stdio.h>
#include <conio.h>
#include <process.h>
#include <dir.h>
#define DIRNAME "testdir.$$$"
int main(void)
{
int stat;
stat = mkdir(DIRNAME);
if (!stat)
printf("Directory created\n");
else
{
printf("Unable to create directory\n");
exit(1);
}
getch();
system("dir/p");
getch();
stat = rmdir(DIRNAME);
if (!stat)
printf("\nDirectory deleted\n");
else
{
perror("\nUnable to delete directory\n");
exit(1);
}
return 0;
}