CU and Tip to VMS hosts

j at lbl-csam.ARPA j at lbl-csam.ARPA
Thu Apr 26 21:06:23 AEST 1984


From:  (Joe Sventek [csam])j at lbl-csam.ARPA

I'm not quite sure what the problem is in all of this discussion.  I have
been successfully using tip to receive/transmit files between our 4.2 UNIX
system and our VMS systems, both over hardwired lines and dialup lines.
All of this business about converting newlines to carriage returns, etc.
is finessed by writing a very simple program on the VMS side - it simply
reads each line of the file specified by the user, sandwiches the record
between \l and \r, and writes it to the terminal using a QIO with the
IO$_NOFORMAT qualifier.  After it has completed transmitting the  file,
it sends a ^Z via the same mechanism.  This permits the user to use the ~<
feature to bring files from the VMS system to the UNIX system.  Attached is
the source for such a program which can be built as part of the LBL Software
Tools for VMS.

Transmitting files to the VMS system from the UNIX system works as follows:

1. Start a program on the VMS side which is reading the terminal and placing
   the input into a file - "cat >file" works quite nicely.
2. ~s echocheck
3. ~> unix_file
4. ~s !echocheck

The echocheck feature causes tip to compare each echoed character with the one
just sent, thus providing ~95% assurance of successful transfer.

Just in case you think that we are using different entries in our remote
database, I have included the three line definitions we use to vms hosts.

vms9600|9600 Baud direct-connection to a VMS system:\
	:el=^U^C^R^O^D^S^Q^Y^Z:ie=^Z:oe=^Z:br#9600:
vms1200|1200 Baud dial-out to a VMS system:\
	:el=^U^C^R^O^D^S^Q^Y^Z:ie=^Z:oe=^Z:tc=dial1200:
vms300|300 Baud dial-out to another VMS system:\
	:el=^U^C^R^O^D^S^Q^Y^Z:ie=^Z:oe=^Z:tc=dial300:

The final point which needs to be made is that when one stoops to using this
type of software for transferring files, there is no need to worry about the
respective file formats.  These types of programs implicitly convert the data
to and from "terminal ascii" format - i.e that necessary to drive ascii
terminals.  The only thing that can cause even minor problems is where the
CRLF sequence is placed with respect to the data - the simple attached program
guarantees that the sending image on the VMS side uses the same convention
as UNIX does.  As for sending a file to VMS, the echocheck feature guarantees
that you do not overrun buffers, and tip automatically converts the newline
at the end of each line to a carriage return, since it is supposed to be
emulating a user at a terminal.  Of course, higher speeds can be achieved if
you write a program on VMS which

1. sets the terminal to noecho mode
2. sets the terminal to HOSTSYNC (similar to tandem)
3. reads the input up to a ^Z and places it in a file
4. resets the terminal to ECHO and NOHOSTSYNC

For those who are worried about more reliable transfer of files over such
links, I have successfully integrated the kermit protocol into tip.  We are
in the final debugging stage of this addition, and I will make the source
modifications available as soon as we are sure that no bugs lurk beneath the
surface.

					Joe Sventek

------------ ucat.r for VMS -------------------
#-h- main             745  asc  30-apr-82 16:01:34  j (sventek j)
 ## cat - concatenate named files onto standard output
 DRIVER(cat)
 
 character buf(MAXLINE)
 integer getarg, open, stmode
 integer i, int
 
 call query("usage:  ucat [file] ...")
 if (stmode(STDOUT, RARE) != RARE)
    call error("Cannot set standard output to rare mode.")
 for (i=1; getarg(i, buf, MAXLINE) != EOF; i=i+1)
	    {
	    if (buf(1) == '-' & buf(2) == EOS)
		int = STDIN
	    else
		int = open(buf, READ)
            if (int == ERR)
		call cant(buf)
            call rawcpy(int, STDOUT)
            if (int != STDIN)
		call close(int)
	    }
	if (i == 1)	# no arguments passed
		call rawcpy (STDIN, STDOUT)
	call putch('@n', STDOUT)		# flush the last line
        call putch(SUB, STDOUT)			# end of file to UNIX

        DRETURN
	end
#-h- rawcpy           242  asc  05-feb-82 08:57:10  j
subroutine rawcpy(fdi, fdo)

filedes fdi, fdo
character buf(MAXLINE)
integer getlin, length
integer n

buf(1) = '@n'
while (getlin(buf(2), fdi) != EOF)
  {
  n = length(buf)
  call chcopy('@r', buf, n)
  call putlin(buf, fdo)
  }

return
end



More information about the Comp.unix.wizards mailing list