home *** CD-ROM | disk | FTP | other *** search
- /* VArc.rexx by Luca Spada '91 (to use with SkyFreq)
-
- Show archive contents of (.ARC, .ZOO, .LZH, .ZIP, .ARJ, .DMS, .APE)
-
- */
-
- options failat 10
-
- signal on halt
- signal on ioerr
- signal on break_c
-
- parse source type .
- isfunc = (type == "FUNCTION")
-
- cfg. = ""
-
- cfg.arc.cmd = "c:PKAX"
- cfg.arc.v = "-v"
-
- cfg.zoo.cmd = "c:booz"
- cfg.zoo.v = "l"
-
- cfg.lzh.cmd = "c:Lz"
- cfg.lzh.v = "v"
-
- cfg.zip.cmd = "c:UnZip"
- cfg.zip.v = "-v"
-
- cfg.ape.cmd = "c:APE"
- cfg.ape.v = "v"
-
- cfg.dms.cmd = "c:viewdms"
- cfg.dms.v = ""
-
- cfg.arj.cmd = "c:unarj"
- cfg.arj.v = "v"
-
- ext = "ZOO LZH ARC ZIP APE DMS ARJ"
- outfile = ''
-
- com = "V"
-
- parse arg file .
-
-
- ofile = file
-
-
- do while ~exists(file)
- parse var ext this ext
- if this = "" then do
- exit 20
- end
-
- file = ofile"."this
- end
-
-
- if ~open('in', file, 'R') then do
- exit 20
- end
-
- buff = readch('in', 8)
- call close('in')
-
- select
- when left(buff, 4) == 'ZOO ' then type = zoo
- when left(buff, 4) == '$JGE' then type = ape
- when substr(buff, 3, 3) == '-lh' then type = lzh
- when left(buff, 1) == '1A'x then type = arc
- when left(buff, 2) == 'PK' then type = zip
- when left(buff, 3) == 'DMS' then type = dms
- when left(buff, 2) == '60ea'x then type = arj
- otherwise do
- exit 20
- end
- end
-
- /* fix APE bug */
- if type = ape & infiles = '' then infiles = '#?'
-
- comma = cfg.type.cmd||" "||cfg.type.com||" "||file
-
- address command comma
-
- exit
-
- /* Error Handling */
-
- halt:
- ioerr:
- break_c:
- exit 20
-