REXX Procedure for Host Upload

/*put a file on the host*/
'@echo off'
arg file
lastdot=lastpos('.',file)
lastbslash=lastpos('\',file)
ext=substr(file,lastdot+1) fn=substr(file,lastbslash+1,
lastdot-lastbslash-1)
select
when ext='SCR'  then ft='SCRIPT'
when ext='TXT'  then ft='TEXT'
when ext='PSE'  then ft='PSEBIN'
when ext='BMP'  then ft='BMPBIN'
otherwise  ft=ext
end
select
when ext='SCR'  then opt=asc
when ext='TXT'  then opt=asc
when ext='CMD'  then opt=asc
when fn='CONFIG' & ext='SYS'  then opt=asc
when ext='BAT'  then opt=asc
when ext='RC'  then opt=asc
otherwise  opt='(RECFM V'
end
if opt=asc then
opt='(ASCII CRLF RECFM V LRECL 255' 'SEND' file fn ft 'A' opt
'exit'


[Back: A REXX Procedure To Prevent Programs Restarting]
[Next: REXX Procedure to Create a New Folder]