home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / CLIPB52.ZIP / HUFF.ZIP / RMDIR.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-05-23  |  1.7 KB  |  61 lines

  1. ;-------------------------------------------------------------------------
  2. ; ** CLIPnet Library ** copyright of DataSync Technologies - Lansing, Mi
  3. ;-------------------------------------------------------------------------
  4. ;
  5. ; Functions: rmdir()
  6. ;
  7. ;        by: Carl Huff
  8. ;
  9. ;   Purpose: Clipper equivalent to DOS's `rmdir' commands
  10. ;
  11. ;       Use: RmDir(<directory to kill>)          ie: RmDir("\TEMP")
  12. ;
  13. ;   Returns: Clipper logical .T. (success) or logical .F. (fail)
  14. ;
  15. ;   ** to be Compiled with Microsoft Macro Assembler vrsn 5.1 **
  16. ;-------------------------------------------------------------------------
  17.  
  18. .MODEL LARGE, PASCAL
  19. PUBLIC  rmdir
  20.  
  21. EXTRN __parc:FAR
  22. EXTRN __retl:FAR
  23.  
  24. .CODE
  25. ;----------------------
  26. rmdir   PROC FAR                ; /**** RmDir() function ****/
  27. ;----------------------
  28.  
  29.         push    ds
  30.  
  31.         mov     ax, 1           ; param_num
  32.         push    ax
  33.         call    __parc          ; call Clipper
  34.         add     sp, 2           ; clean the stack
  35.  
  36.         push    ax
  37.         push    dx              ; get the string address
  38.         pop     ax
  39.         mov     ds, ax
  40.         pop     ax
  41.         mov     dx, ax          ; DS:DX now points to string
  42.  
  43.         mov     ah, 3ah         ; DOS RMDIR
  44.         int     21h
  45.         jc      errors          ; if failed ....
  46.         mov     ax, 1
  47.         jmp     done
  48. errors:
  49.         mov     ax, 0
  50. done:
  51.         pop     ds
  52.         push    ax
  53.         call    __retl          ; return logical to Clipper
  54.         add     sp, 2
  55.         ret                     ; return to Clipper
  56.  
  57. rmdir   ENDP
  58. END
  59. ;-------------------------------------------------------------------------
  60. ;/* EOF DirStuff */
  61.