home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c005 / 4.ddi / C / FLDELETE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-05  |  869 b   |  38 lines

  1. /**
  2. *
  3. * Name        fldelete -- Delete a file
  4. *
  5. * Synopsis    ercode = fldelete(pfile);
  6. *
  7. *        int  ercode      DOS function return error code
  8. *        char *pfile      Full path name of file to delete
  9. *
  10. * Description    This function deletes the file specified in the path
  11. *        name.
  12. *
  13. *        Read-only files cannot be deleted until their attribute
  14. *        is changed (use FLRETATR and FLSETATR).  Directories
  15. *        cannot be deleted with FLDELETE (use DRRMDIR).
  16. *
  17. * Returns    ercode          DOS function return error code
  18. *
  19. * Version    3.0  (C)Copyright Blaise Computing Inc.  1983, 1984, 1986
  20. *
  21. **/
  22.  
  23. #include <bfile.h>
  24.  
  25. int fldelete(pfile)
  26. char *pfile;
  27. {
  28.     DOSREG dos_reg;
  29.     ADS    file_ads;
  30.  
  31.     dos_reg.ax = 0x4100;          /* DOS function 0x41          */
  32.     utabsptr(pfile,&file_ads);
  33.     dos_reg.ds = file_ads.s;
  34.     dos_reg.dx = file_ads.r;
  35.  
  36.     return(dos(&dos_reg));
  37. }
  38.