home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
TE2HOST.ZIP
/
ACTN_1.SCR
< prev
next >
Wrap
Text File
|
1990-12-27
|
4KB
|
141 lines
global integer MLevelMain
global integer MLevelFile
global integer MLevelMail
global integer MLevelProto
global integer MLevelSysop
global integer XFerUpLoad
global integer XFerDownLoad
global string CmdStack
global string FileSpec
global string DfltSpec
global integer MenuLevel
global integer XFerType
global integer UserLevel
string buffer
integer mch
integer retcode
;; ------------------------------------------------------------------------
;; Show the user a disk directory via a shell to cmd.exe's "dir" command.
;; The user response here is not monitored but it probably should be
;; limited to the current directory for users with lower priv levels.
subroutine DiskDirectory
transmit("^M^JFile Directory")
DfltSpec = "*.*"
run("getfspec")
transmit("^[[2J")
message("^M^JUser is obtaining file directory [%s]", FileSpec)
buffer = sprintf("/c dir %s", FileSpec)
retcode = rshell("cmd.exe", buffer, 1)
if (retcode != 0)
transmit("^M^JError reading directory")
endif
transmit("^M^JPress any key to continue...")
rgetc(30, 1)
endsub
;; ------------------------------------------------------------------------
;; 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
DfltSpec = ""
run("getfspec")
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
mch = asciival(toupper(CmdStack))
CmdStack = strtrim(substr(CmdStack, 1, 255))
;; Check invalid user levels
if mch == 'C' and UserLevel < 2
mch = 0
endif
if mch == 'F'
gosub DiskDirectory
elseif mch == 'C'
run("chdir.scr")
elseif mch == 'U'
XFerType = XFerUpLoad
MenuLevel = MLevelProto
elseif mch == 'D'
XFerType = XFerDownLoad
MenuLevel = MLevelProto
elseif mch == 'T'
run("typefile.scr")
elseif mch == 'V'
run("viewzip.scr")
elseif mch == 'G'
run("goodbye")
elseif mch == 'M'
MenuLevel = MLevelMain
else
transmit("^G")
CmdStack = ""
endif
end