home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / sysutl / tools.lbr / DL.AZM / DL.ASM
Assembly Source File  |  1987-08-06  |  1KB  |  65 lines

  1.     INCLUDE    MACROS.LIB
  2.  
  3.  
  4. ; File Delete
  5.  
  6. ; This is a system utility program to handle file deletes.
  7. ; Multiple filenames, optional commas for delimiters, and
  8. ; wildcards are supported. Usage is:
  9.  
  10. ;    DL <filename> [ [,] <filename>]
  11.  
  12. ; The filenames may include optional drive designations
  13.  
  14.  
  15. DL:    PROLOG            ;set up initialization
  16.  
  17.     LXI    H, DMABUF
  18.     CALL    SETDMA
  19.  
  20.     CALL    INCL        ;Get the command tail
  21.     LXI    D, DEFFCB    ;Point to default FCB
  22.     CALL    GETDFN        ;Get a filename
  23.     JRNC    LOOP        ;If name present, go do it
  24.     CALL    ILPRINT        ;Else tell him correct usage
  25.  
  26.     DB    'Usage: dl <filename> [[,] <filename>]', CR, LF, 0
  27.  
  28.     JR    FINIS        ;And abort
  29.  
  30. LOOP:    CALL    $DELETE        ;Do ther delete
  31.     JRNC    OK        ;Did we get it?
  32.     CALL    ILPRINT        ;If not, tell him no can do
  33.  
  34.     DB    'Cannot delete ', 0
  35.  
  36.     JR    NEXT        ;And try the next one
  37.  
  38. OK:    CALL    ILPRINT        ;Else report success
  39.  
  40.     DB    'Deleting ', 0
  41.  
  42. NEXT:    CALL    SHODFN        ;Show the current filename
  43.     CALL    CRLF
  44.     CALL    COMMA        ;Skip delimiters
  45.     CALL    GETDFN        ;Get another filename
  46.     JRNC    LOOP        ;If there, go handle it
  47.  
  48.     CALL    FIN        ;Check for clean end of line
  49.     JRNC    FINIS        ;If OK, quit
  50.     CALL    ILPRINT        ;Else tell him about bad line
  51.  
  52.     DB    'Cannot understand ',0
  53.  
  54.     CALL    PRINT        ;Print the remaining text
  55.     CALL    CRLF
  56.  
  57. FINIS:    EPILOG            ;clean up and quit
  58.  
  59.     COMMON /BUFFERS/
  60.  
  61. DMABUF:    DS    0        ;data storage for DMA
  62. ;
  63.     END
  64. ;
  65.