c subroutine rcpfile(lu,local,remot) character*(*) remot,local character*124 command character*80 msserr logical isopen,exists integer getenv c lenremot = lenstr(remot) lenlocal = lenstr(local) if (lu.gt.0.and.lu.le.99) then inquire(lu,opened=isopen) if (isopen) then write(6,"('rcpfile: closing unit ',i2)") lu close(lu) endif endif inquire(file=local,exist=exists) if (.not.exists) then write(6,"('rcpfile: cannot find file ',a,' -- no rcp done')") + local return endif write(command,"('rcp ',a,' ',a)") + local(1:lenlocal),remot(1:lenremot) istat = ishell(command) if (istat.eq.0) then write(6,"('Copied file ',a,' to remote ',a)") + local(1:lenlocal),remot(1:lenremot) else write(6,"(/72('>'))") write(6,"('AN ERROR HAS OCCURRED USING RCP TO TRANSFER ')") write(6,"('LOCAL FILE ',a,' TO REMOTE FILE (OR DIR) ',a)") + local(1:lenlocal),remot(1:lenremot) write(6,"(' ')") write(6,"('The command that failed was as follows:',/a)") + command(1:lenstr(command)) write(6,"(' ')") c c rcp failed -- save on mss as /USER/local: c write(6,"('Because rcp failed, the local file ',a, + ' will be stored on mss as',/,' /USER/',a, + ', where ''USER'' is your (upper case) login name',/ + ' (i.e., your mss root directory)')") + local(1:lenlocal),local(1:lenlocal) call sendms(local,local) write(6,"(72('>')/)") endif return end