您现在的位置:多问网知识中心电脑教学软件技巧磁盘文件粉碎机

磁盘文件粉碎机

10-12 03:10:19   浏览次数:74026  栏目:软件技巧
标签:办公软件技巧,软件测试面试技巧,办公软件使用技巧,http://www.duowen123.com 磁盘文件粉碎机,
 你可以将它放到DOS目录下,作为DOS的外部命令使用。
        使用格式为:C:\>XDEL 文件名〈回车〉
        XDEL是一个十分危险的命令,使用时需要十分小心,一失足将成千古恨!故此XDEL在每删除一个文件时均给出一个确认信息如下:
        Are you sure?
        键入Y表示删除,键入N表示不删除。
        XDEL.C的源程序如下:
        #include "dos.h"
        #include "stdio.h"
        #include "stdlib.h"
        #include "io.h"
        #include "fcntl.h"
        #include "string.h"
        #include "mem.h"
        #define SIZE 1024
        main(int argc,char *argv)
        {
        FILE *fp;
          int fd,fsize,fnum;
          char *buf;
          int ch;
          if(argc!=2) {
        printf("\nUsage: c:\\>xdel filename.ext\n");
        exit(1);
        }
          printf("\nAre you sure?");
        ch=getce();
          if ((ch!='y')&&(ch!='Y')) exit(1);
          if((access(argv,0))==-1)  {
        printf("\nFile %s does not exist.\n",argv);
        exit(1);
        }
          _chmod(argv,1,FA_HIDDEN);
          if ((fd=_open(argv,O_RDWR))==-1) {
        printf("\nCan not open file %s.\n",argv);
        exit(1);
        }
          fsize=filelength(fd);
          fnum=fsize/SIZE+1;
          memset(buf,'\0',SIZE);
          do {
        write(fd,buf,SIZE);--fnum;
        } while(fnum>0);
          close(fd);
          fp=fopen(argv,"w");
          fclose(fp);
          rename(argv,"@");
          unlink("@");
        }
        本程序在AST 386/25上TURBO C 2.0版下调试通过。  (成都 成文佳)
 

,磁盘文件粉碎机
相关热词搜索: tag: 软件技巧,办公软件技巧,软件测试面试技巧,办公软件使用技巧,电脑教学 - 软件技巧
上一篇:软解压舞台的又一新星——SOFTPEG
《磁盘文件粉碎机》相关文章
文章评论
联系我们 | 网站地图 | 范文大全 | 管理资料 | 驾照考试 | 教学资料 | 名言大全 | 软件下载
Copyright @ 多问网 all rights reserved
学生评语_教案设计_小学语文试卷
1 2 3 4 5 6 7 8 9 10 11 12