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

  1. /*-----------------------------------------------------------------------*
  2.  * filename - rmdir.cas
  3.  *
  4.  * function(s)
  5.  *        rmdir - removes directory
  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 <dir.h>
  20. #include <_io.h>
  21.  
  22. /*-----------------------------------------------------------------------*
  23.  
  24. Name            rmdir - removes directory
  25.  
  26. Usage           int rmdir(const char *pathname);
  27.  
  28. Prototype in    dir.h
  29.  
  30. Description     deletes the directory given by pathP.  The directory
  31.                 named by pathP
  32.  
  33.                         1) must be empty
  34.  
  35.                         2) must not be the current working directory
  36.  
  37.                         3) must not be the root directory
  38.  
  39. Return value    success : 0
  40.                 failure : -1 and errno is set to one of the following:
  41.  
  42.                         EACCES  Permission denied
  43.                         ENOENT  Path or file name not found
  44.  
  45. *------------------------------------------------------------------------*/
  46. int rmdir(const char *pathP)
  47. {
  48.         pushDS_
  49. asm     mov     ah, 03Ah
  50. asm     LDS_    dx, pathP
  51. asm     int     021H
  52.         popDS_
  53. asm     jc      rmdirFailed
  54.         return(0);
  55.  
  56. rmdirFailed:
  57.         return __IOerror(_AX);
  58. }
  59.