home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
TE2HOST.ZIP
/
VIEWZIP.SCR
< prev
next >
Wrap
Text File
|
1990-12-27
|
3KB
|
96 lines
;; --------------------------------------------------------------------------
;;
;; ViewZIP.scr -- Host mode script suite for TE/2
;; Copyright 1990, Oberon Software, All rights reserved
;;
;; --------------------------------------------------------------------------
global string CmdStack
global string FileSpec
global string DfltSpec
global integer WatchUser
;; ---------------------------------------------------
;; Archivers, modify these to match your system setup:
string PkUnZip = "pkunzip"
string SeaArc = "arc2"
string LhArc = "lharc2"
string Zoo = "zoo"
string buffer
integer retcode
;; ------------------------------------------------------------------------
;; Perform a verbose listing os the contents of a ZIP, ARC, LZH, or ZOO
;; archive. If you don't have all of these archive programs, you'll
;; probably want to comment out part of this routine. Note that the
;; names of the archivers are stored in variables, if they are named
;; something different on your system, or need to be pathed to, they
;; can easily be changed.
subroutine ViewArchive
if strlen(CmdStack) == 0
transmit("^M^JView ZIP or ARC File:")
DfltSpec = ""
run("getfspec.scr")
else
FileSpec = CmdStack
CmdStack = ""
endif
if strlen(FileSpec)
;; If the FileSpec is shorter than 5 characters it CAN'T have and
;; extension, add ".zip"
if strlen(FileSpec) < 5
FileSpec = FileSpec + ".ZIP"
endif
;; Extract the extension into buffer
buffer = strright(FileSpec, 4)
buffer = toupper(buffer)
;; Now, make sure that it IS an extension, if not, add ".zip"
if asciival(buffer) != asciival(".")
FileSpec = FileSpec + ".ZIP"
buffer = ".ZIP"
endif
transmit("^M^J")
message("^M^JUser is viewing archive [%s]", FileSpec)
;; Execute the proper archiver based on extension
if strcmp(buffer, ".ZIP") == 0
buffer = sprintf("-v %s", FileSpec)
retcode = rshell(PkUnZip, buffer, 1)
elseif strcmp(buffer, ".ARC") == 0
buffer = sprintf("v %s", FileSpec)
retcode = rshell(SeaArc, buffer, 1)
elseif strcmp(buffer, ".LZH") == 0
buffer = sprintf("-v %s", FileSpec)
retcode = rshell(LhArc, buffer, 1)
elseif strcmp(buffer, ".ZOO") == 0
buffer = sprintf("v %s", FileSpec)
retcode = rshell(Zoo, buffer, 1)
else
transmit("^M^JSorry, don't know how to view ""%s"".", FileSpec)
retcode = 0
endif
if retcode != 0
transmit("^M^JError executing archive program")
endif
transmit("^M^JPress any key to continue...")
rgetc(30, 1)
endif
endsub
program
gosub ViewArchive
end