设为首页 加入收藏 繁体中文
当前位置:速查手册首页 >> 函数命令 >> r >> C语言函数: rmdir
C语言函数: rmdir
2008-09-03 14:08:15  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
  •   功 能: 删除DOS文件目录

函数名: rmdir
功  能: 删除DOS文件目录
用  法: 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;
}

0

顶一下

0

踩一下
友情链接 | 诚聘英才 | 关于我们 | 版权声明 | 联系我们 | 广告服务

  • 〖 颖思设计 ☆ WinYes.COM 〗
  • 在线咨询:   
  •     粤ICP备05002304号