C语言函数—intdosx

函数名

intdos

功 能

通用DOS接口

用 法

int intdos(union REGS *inregs, union REGS *outregs);

程序例

#include <stdio.h> 
#include <dos.h> 

/* deletes file name; returns 0 on success, nonzero on failure */ 
int delete_file(char near *filename) 
{ 
   union REGS regs; 
   int ret; 
   regs.h.ah = 0x41;                            /* delete file */ 
   regs.x.dx = (unsigned) filename; 
   ret = intdos(®s, ®s); 

   /* if carry flag is set, there was an error */ 
   return(regs.x.cflag ? ret : 0); 
} 

int main(void) 
{ 
   int err; 
   err = delete_file("NOTEXIST.$$$"); 
   if (!err) 
      printf("Able to delete NOTEXIST.$$$n"); 
   else 
      printf("Not Able to delete NOTEXIST.$$$n"); 
   return 0; 
} 
  
  
  

如果引用本站的原创文章,请注明原文链接:,本站保留追究责任的权利!
评论已关闭。