home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 2.ddi / CLIB2.ZIP / RMDIR.CAS < prev    next >
Encoding:
Text File  |  1990-06-07  |  1.7 KB  |  60 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - rmdir.cas
  3.  *
  4.  * function(s)
  5.  *        rmdir - removes directory
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*[]------------------------------------------------------------[]*/
  9. /*|                                                              |*/
  10. /*|     Turbo C Run Time Library - Version 3.0                   |*/
  11. /*|                                                              |*/
  12. /*|                                                              |*/
  13. /*|     Copyright (c) 1987,1988,1990 by Borland International    |*/
  14. /*|     All Rights Reserved.                                     |*/
  15. /*|                                                              |*/
  16. /*[]------------------------------------------------------------[]*/
  17.  
  18. #pragma inline
  19. #include <asmrules.h>
  20. #include <dir.h>
  21. #include <_io.h>
  22.  
  23. /*-----------------------------------------------------------------------*
  24.  
  25. Name            rmdir - removes directory
  26.  
  27. Usage           int rmdir(const char *pathname);
  28.  
  29. Prototype in    dir.h
  30.  
  31. Description     deletes the directory given by pathP.  The directory
  32.         named by pathP
  33.  
  34.             1) must be empty
  35.  
  36.             2) must not be the current working directory
  37.  
  38.             3) must not be the root directory
  39.  
  40. Return value    success : 0
  41.         failure : -1 and errno is set to one of the following:
  42.  
  43.             EACCES    Permission denied
  44.             ENOENT    Path or file name not found
  45.  
  46. *------------------------------------------------------------------------*/
  47. int rmdir(const char *pathP)
  48. {
  49.     pushDS_
  50. asm    mov    ah, 03Ah
  51. asm    LDS_    dx, pathP
  52. asm    int    021H
  53.     popDS_
  54. asm    jc    rmdirFailed
  55.     return(0);
  56.  
  57. rmdirFailed:
  58.     return __IOerror(_AX);
  59. }
  60.