home *** CD-ROM | disk | FTP | other *** search
/ AMIGA PD 1 / AMIGA-PD-1.iso / Programme_zum_Heft / Programmieren / Kurztests / ACE / Prgs / ShellUtils / massFD.b < prev    next >
Text File  |  1994-11-18  |  1KB  |  50 lines

  1. {*
  2. ** Process each FD file in a specified directory and copy the resulting
  3. ** bmap file to the ACEbmaps: directory.
  4. **
  5. ** FD filenames must end in "_lib.fd" to be recognised as valid FD
  6. ** files here.
  7. **
  8. ** This program assumes the existence of ACE:utils/fd2bmap/fd2bmap.
  9. **
  10. ** More sanity checks could be added.
  11. **
  12. ** Author: David J Benn
  13. **   Date: 18th November 1994
  14. *}
  15.  
  16. SUB cleanup
  17.   CLOSE #1
  18.   KILL "ram:my_FD_dir"
  19. END SUB
  20.  
  21. IF ARGCOUNT<>1 THEN
  22.   PRINT "usage: ";ARG$(0);" source-directory"
  23. ELSE
  24.   ON BREAK GOTO quit
  25.   BREAK ON
  26.   theDir$ = ARG$(1)
  27.   FILES TO "ram:my_FD_dir", theDir$
  28.   IF RIGHT$(theDir$,1) <> ":" THEN theDir$ = theDir$+"/"   '..dir or volume?
  29.   OPEN "I",#1,"ram:my_FD_dir"
  30.   IF NOT EOF(1) THEN LINE INPUT #1,f$    '..skip first line
  31.   WHILE NOT EOF(1)
  32.     LINE INPUT #1,f$
  33.     IF UCASE$(RIGHT$(f$,7)) <> "_LIB.FD" THEN
  34.       PRINT f$;" -> not a valid FD file."
  35.     ELSE
  36.       PRINT f$;" -> converting - ";
  37.       SYSTEM "ACE:utils/fd2bmap/fd2bmap >NIL: "+ ~
  38.              theDir$+LEFT$(f$,INSTR(f$,"_")-1)+" ACEbmaps:"
  39.       PRINT "done."
  40.     END IF
  41.   WEND
  42.   cleanup
  43. END IF
  44. STOP
  45.  
  46. quit:
  47.   PRINT "**Break: ";ARG$(0);" terminating!"
  48.   cleanup
  49. END
  50.