home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
TE2HOST.ZIP
/
ACTN_98.SCR
< prev
next >
Wrap
Text File
|
1990-12-27
|
4KB
|
168 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
integer mch
integer retcode
string xferstrg
subroutine GetFileSpec
if strlen(CmdStack) == 0
transmit("^M^J%s a File", xferstrg)
DfltSpec = ""
run("getfspec.scr")
else
FileSpec = CmdStack
CmdStack = ""
endif
endsub
;; ------------------------------------------------------------------------
;; Receive a file from the user. If you want to keep a record of what
;; files were uploaded and perhaps prompt the user for a verbose
;; description, this will be easy with XModem and XModem-1K however
;; you'll have to get trickier with the batch protocols.
subroutine DoUpload
if connected
xferstrg = "Upload"
if mch == 'X'
gosub GetFileSpec
if strlen(FileSpec)
transmit("^M^JBegin your upload procedures^M^J")
retcode = download(XMODEM, FileSpec)
else
retcode = 999
endif
elseif mch == '1'
gosub GetFileSpec
if strlen(FileSpec)
transmit("^M^JBegin your upload procedures^M^J")
retcode = download(XMODEM1K, FileSpec)
else
retcode = 999
endif
elseif mch == 'Y'
transmit("^M^JBegin your upload procedures^M^J")
retcode = download(YMODEM, NULL)
elseif mch == 'G'
transmit("^M^JBegin your upload procedures^M^J")
retcode = download(YMODEMG, NULL)
elseif mch == 'Z'
transmit("^M^JBegin your upload procedures^M^J")
retcode = download(ZMODEM, NULL)
endif
endif
if connected and retcode != 999
sleep(1000)
if retcode
transmit("^G^G")
transmit("^M^JTransfer successful!^m^J")
else
transmit("^X^X^X^H^H^H^G^G")
transmit("^M^JTransfer failed^M^J")
endif
sleep(1000)
endif
endsub
;; ------------------------------------------------------------------------
;; Send a file to the user. Once again, the FileSpec is not checked
;; before hand to verify that a lower priv user isn't using a path
;; to access files outside the current directory.
subroutine DoDownload
if connected
xferstrg = "Download"
gosub GetFileSpec
if strlen(FileSpec)
transmit("^M^JBegin your download procedures^M^J")
if !WatchUser
message("^M^JUser is downloading [%s]", FileSpec)
endif
if mch == 'X'
retcode = upload(XMODEM, FileSpec)
elseif mch == '1'
retcode = upload(XMODEM1K, FileSpec)
elseif mch == 'Y'
retcode = upload(YMODEM, FileSpec)
elseif mch == 'G'
retcode = upload(YMODEMG, FileSpec)
elseif mch == 'Z'
retcode = upload(ZMODEM, FileSpec)
endif
else
retcode = 999
endif
endif
if connected and retcode != 999
sleep(1000)
if retcode
transmit("^G^G")
transmit("^M^JTransfer successful!^m^J")
else
transmit("^X^X^X^H^H^H^G^G")
transmit("^M^JTransfer failed^M^J")
endif
sleep(1000)
endif
endsub
program
mch = asciival(toupper(CmdStack))
CmdStack = strtrim(substr(CmdStack, 1, 255))
if mch == 'X' or mch == '1' or mch == 'Y' or mch == 'G' or mch == 'Z'
if XFerType == XFerUpLoad
gosub DoUpload
else
gosub DoDownload
endif
MenuLevel = MLevelFile
elseif mch == 'Q'
MenuLevel = MLevelFile
else
transmit("^G")
CmdStack = ""
endif
end