home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 1.ddi / CLIBSRC1.ZIP / REMOVE.CAS < prev    next >
Encoding:
Text File  |  1992-06-10  |  1.7 KB  |  63 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - remove.cas
  3.  *
  4.  * function(s)
  5.  *        remove - deletes a file
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*
  9.  *      C/C++ Run Time Library - Version 5.0
  10.  *
  11.  *      Copyright (c) 1987, 1992 by Borland International
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15.  
  16.  
  17. #pragma inline
  18. #include <asmrules.h>
  19. #include <dos.h>
  20. #include <_io.h>
  21.  
  22. /*-----------------------------------------------------------------------*
  23.  
  24. Name            remove - deletes a file
  25.  
  26. Usage           int remove(const char *filename);
  27.  
  28. Related
  29. functions usage int remove(const char *filename);
  30.  
  31. Prototype in    dos.h
  32.  
  33. Description     remove deletes a file specified by filename. Any
  34.                 MS-DOS drive, path, and file name may be used as a filename.
  35.                 Wildcards are not allowed.
  36.  
  37.                 Read-only files cannot be deleted by this call. To remove
  38.                 read-only files, first use chmod or _chmod to change the
  39.                 read-only attribute.
  40.  
  41.  
  42. Return value    On successful completion, a 0 is returned. On
  43.                 error, a -1 is returned, and errno is set to one of the
  44.                 following values:
  45.  
  46.                         ENOENT  Path or file name not found
  47.                         EACCES  Permission denied
  48.  
  49. *------------------------------------------------------------------------*/
  50. int _CType remove(const char *filename)
  51. {
  52.         pushDS_
  53. asm     mov     ah, 041h
  54. asm     LDS_    dx, filename
  55. asm     int     021H
  56.         popDS_
  57. asm     jc      removeFailed
  58.     return(0);
  59.  
  60. removeFailed:
  61.     return __IOerror(_AX);
  62. }
  63.