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

  1. /*-----------------------------------------------------------------------*
  2.  * filename - mkdir.cas
  3.  *
  4.  * function(s)
  5.  *        mkdir - creates a 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        mkdir - creates a directory
  26.  
  27. Usage        int mkdir(const char *pathname);
  28.  
  29. Related
  30. functions usage    int rmdir(const char *pathname);
  31.  
  32. Prototype in    dir.h
  33.  
  34. Description    mkdir takes the given pathname and creates a new
  35.         directory with that name.
  36.  
  37.         rmdir deletes the directory given by pathname. The
  38.         directory named by pathname
  39.  
  40.             must be empty
  41.  
  42.             must not be the current working directory
  43.  
  44.             must not be the root directory
  45.  
  46. Return value    mkdir returns the value 0 if the new directory was
  47.         created.
  48.  
  49.         rmdir returns 0 if the directory is successfully deleted.
  50.  
  51.         With either function, a return value of -1 indicates an error,
  52.         and errno is set to one of the following values:
  53.  
  54.             EACCES    Permission denied
  55.             ENOENT    Path or file name not found
  56.  
  57. *------------------------------------------------------------------------*/
  58. int mkdir(const char *pathP)
  59. {
  60.     pushDS_
  61. asm    mov    ah, 039h
  62. asm    LDS_    dx, pathP
  63. asm    int    021H
  64.     popDS_
  65. asm    jc    mkdirFailed
  66.     return(0);
  67.  
  68. mkdirFailed:
  69.     return __IOerror(_AX);
  70. }
  71.