home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / comm / skyfr310.lha / varc.rexx < prev   
OS/2 REXX Batch file  |  1992-04-29  |  2KB  |  95 lines

  1. /*  VArc.rexx by Luca Spada '91  (to use with SkyFreq)
  2.  
  3.     Show archive contents of (.ARC, .ZOO, .LZH, .ZIP, .ARJ, .DMS, .APE)
  4.  
  5. */
  6.  
  7. options failat 10
  8.  
  9. signal on halt
  10. signal on ioerr
  11. signal on break_c
  12.  
  13. parse source type .
  14. isfunc = (type == "FUNCTION")
  15.  
  16. cfg.          = ""
  17.  
  18. cfg.arc.cmd   = "c:PKAX"
  19. cfg.arc.v     = "-v"
  20.  
  21. cfg.zoo.cmd   = "c:booz"
  22. cfg.zoo.v     = "l"
  23.  
  24. cfg.lzh.cmd   = "c:Lz"
  25. cfg.lzh.v     = "v"
  26.  
  27. cfg.zip.cmd   = "c:UnZip"
  28. cfg.zip.v     = "-v"
  29.  
  30. cfg.ape.cmd   = "c:APE"
  31. cfg.ape.v     = "v"
  32.  
  33. cfg.dms.cmd   = "c:viewdms"
  34. cfg.dms.v     = ""
  35.  
  36. cfg.arj.cmd   = "c:unarj"
  37. cfg.arj.v     = "v"
  38.  
  39. ext    = "ZOO LZH ARC ZIP APE DMS ARJ"
  40. outfile = ''
  41.  
  42. com = "V"
  43.  
  44. parse arg file .
  45.  
  46.  
  47. ofile = file
  48.  
  49.  
  50. do while ~exists(file)
  51.     parse var ext this ext
  52.     if this = "" then do
  53.         exit 20
  54.      end
  55.     
  56.     file = ofile"."this
  57. end
  58.  
  59.  
  60. if ~open('in', file, 'R') then do
  61.   exit 20
  62. end
  63.  
  64. buff = readch('in', 8)
  65. call close('in')
  66.  
  67. select
  68.   when left(buff, 4)      == 'ZOO '  then type = zoo
  69.   when left(buff, 4)      == '$JGE'  then type = ape
  70.   when substr(buff, 3, 3) == '-lh'   then type = lzh
  71.   when left(buff, 1)      == '1A'x   then type = arc
  72.   when left(buff, 2)      == 'PK'    then type = zip
  73.   when left(buff, 3)      == 'DMS'   then type = dms
  74.   when left(buff, 2)      == '60ea'x then type = arj
  75.   otherwise do
  76.       exit 20
  77.   end
  78. end
  79.  
  80. /* fix APE bug */
  81. if type = ape & infiles = '' then infiles = '#?'
  82.  
  83. comma = cfg.type.cmd||" "||cfg.type.com||" "||file
  84.  
  85. address command comma
  86.  
  87. exit
  88.  
  89. /* Error Handling */
  90.  
  91. halt:
  92. ioerr:
  93. break_c:
  94.     exit 20
  95.