'\" Revision Level 
'\" Last Delta     03-06-88
.TH RZ 1 OMEN
.SH NAME
rx, rb, rz \- XMODEM, YMODEM, ZMODEM (Batch) file receive
.SH SYNOPSIS
.B rz
.RB [\- "\ +1abepqtuv" ]
.br
.B rb
.RB [\- "\ +1abqtuv" ]
.br
.B rx
.RB [\- "\ 1abceqtuv" ]
.I file
.br
.B gz
.I "file ..."
.br
.RB [ \- ][ v ] rzCOMMAND
.SH DESCRIPTION
This program uses error correcting protocols to receive
files over a dial-in serial port from a variety of programs running under
PC-DOS, CP/M,
.SM Unix,
and other operating systems.
It is invoked from a shell prompt
manually, or automatically as a result of an
"sz file ..." command given to the calling program.

While
.I rz
is smart enough to be called from
.I cu(1),
very few versions of
.I cu(1)
are smart enough to allow
.I rz
to work properly.
Unix flavors of Professional-YAM are available for such dial-out application.


.B Rz
(Receive ZMODEM)
receives files with the ZMODEM batch protocol.
Pathnames are supplied by the sending program,
and directories are made if necessary (and possible).
Normally, the
"rz" command is automatically issued by the calling ZMODEM program,
but some defective ZMODEM implementations may require starting
.I rz
the old fashioned way.


.B Rb
receives file(s) with YMODEM,
accepting either standard 128 byte sectors or
1024 byte sectors
(YAM sb
.B -k
option).
The user should determine when
the 1024 byte block length
actually improves throughput without causing lost data
or even system crashes.

If True YMODEM (Omen Technology trademark) file information (file length, etc.)
is received,
the file length controls the number of bytes written to
the output dataset,
and the modify time and file mode
(iff non zero)
are set accordingly.

If no True YMODEM file information is received,
slashes in the pathname are changed to underscore,
and any trailing period in the pathname is eliminated.
This conversion is useful for files received from CP/M systems.
With YMODEM, each file name is converted to lower case
unless it contains one or more lower case letters.


.B Rx
receives a single
.I file
with XMODEM or XMODEM-1k protocol.
The user should determine when
the 1024 byte block length
actually improves throughput without causing problems.
The user must supply the file name to both sending and receiving programs.
Up to 1023 garbage characters may be added to the received file.

.B Gz
is a shell script which calls
.I sz
to command Pro-YAM or ZCOMM to transmit the specified files.
Pathnames used with
.I gz
must be escaped if they have special significance to the Unix shell.
.br
EXAMPLE:
gz "-a C:*.c D:*.h"


.B Rz
may be invoked as
.B rzCOMMAND
(with an optional leading \- as generated by login(1)).
For each received file,
.I rz
will pipe the file to ``COMMAND filename''
where filename is the name of the transmitted file
with the file contents as standard input.

Each file transfer is acknowledged when COMMAND exits with 0 status.
A non zero exit status terminates transfers.

A typical use for this form is
.I rzrmail
which calls rmail(1)
to post mail to the user specified by the transmitted file name.
For example, sending the file "caf" from a PC-DOS system to
.I rzrmail
on a
.SM Unix
system
would result in the contents of the DOS file "caf" being mailed to user "caf".

On some
.SM Unix
systems, the login directory must contain a link to
COMMAND as login sets SHELL=rsh which disallows absolute
pathnames.
If invoked with a leading ``v'',
.I rz
will report progress to /tmp/rzlog.
The following entry works for
.SM Unix
SYS III/V:
.ce
rzrmail::5:1::/bin:/usr/local/rzrmail
If the SHELL environment variable includes
.I "rsh"
or
.I "rksh"
(restricted shell),
.I rz
will not accept absolute pathnames
or references to a parent directory,
will not modify an existing file, and
removes any files received in error.

If
.B rz
is invoked with stdout and stderr to different datasets,
Verbose is set to 2, causing frame by frame progress reports
to stderr.
This may be disabled with the
.B q
option.

.PP
The meanings of the available options are:
.PP
.PD 0
.TP
.B 1
Use file descriptor 1 for ioctls and reads (Unix only).
By default, file descriptor 0 is used for ioctls and reads.
This option allows
.B rz
to be used with the
.I Professional-YAM
.B $
command
and some versions of ncu(1), but not cu(1).
.TP
.B a
Convert files to
.SM Unix
conventions by stripping carriage returns and all characters
beginning with the first Control Z (CP/M end of file).
.TP
.B b
Binary
(tell it like it is)
file transfer override.
.TP
.B c
Request 16 bit CRC.
XMODEM file transfers default to 8 bit checksum.
YMODEM and ZMODEM normally use 16 bit CRC.
.TP
.B D
Output file data to /dev/null; for testing.
.TP
.B e
Force sender to escape all control characters;
normally XON, XOFF, DLE, CR-@-CR, and Ctrl-X are escaped.
.TP
.B p
(ZMODEM) Protect: skip file if destination file exists.
.TP
.B q
Quiet suppresses verbosity.
.TP
.B "t tim"
Change timeout to
.I tim
tenths of seconds.
.TP
.B v
Verbose
causes a list of file
names to be appended to
/tmp/rzlog .
More v's generate more output.
.PD
.ne 6
.SH EXAMPLES
.RE
(Pro-YAM command)
.RS
.I <ALT-2>
.br
Pro-YAM Command:
.I "sz *.h *.c"
.br
(This automatically invokes
.I rz
on the connected system.)
.RE
.SH SEE ALSO
ZMODEM.DOC,
YMODEM.DOC,
IMP(CP/M),
Professional-YAM,
sz(omen),
usq(omen),
undos(omen)

Compile time options required
for various operating systems are described in the
source file.
.SH NOTES
Sending serial data to timesharing minicomputers
at sustained high speeds
has been known to cause lockups, system halts, kernel panics,
and occasional antisocial behaviour.
When experimenting with high speed input to a
system, consider rebooting the system
if the file transfers are not successful,
especially if the personality of the system appears altered.

The Unix "ulimit" parameter must be set high enough
to permit large file transfers.

The TTY input buffering on some systems may not allow long blocks
or streaming input at high speed.
You should suspect this problem when you
can't send data to the Unix system at high speeds using ZMODEM,
YMODEM-1k or XMODEM-1k,
when YMODEM with 128 byte blocks works properly.
If the system's tty line handling is really broken, the serial port
or the entire system may not survive the onslaught of long bursts
of high speed data.

The DSZ or Pro-YAM
.B "zmodem l"
numeric parameter may be set to a value between 64 and 1024 to limit the
burst length ("zmodem pl128").

32 bit CRC code courtesy Gary S. Brown.
Directory creation code from John Gilmore's PD TAR program.
.SH BUGS
Calling
.I rz
from most versions of cu(1) doesn't work because cu's receive process
fights
.I rz
for characters from the modem.

Programs that do not properly implement the specified file transfer protocol
may cause
.I sz
to "hang" the port for a minute or two.
Every reported instance of this problem has been corrected by using
ZCOMM, Pro-YAM, or other program with a correct implementation
of the specified protocol.

Many programs claiming to support YMODEM only support XMODEM with 1k blocks,
and they often don't get that quite right.

Pathnames are restricted to 127 characters.
In XMODEM single file mode, the pathname given on the command line
is still processed as described above.
The ASCII option\'s CR/LF to NL translation merely deletes CR\'s;
undos(omen) performs a more intelligent translation.
.SH "VMS VERSION"
Some of the #includes with file names enclosed with angle brackets <>
may need to have the angle brackets changed to "", or vice versa.

The VMS version does not set binary mode according to the incoming
file type.
Non binary file processing consists of stripping all characters beginning
with CPMEOF (^Z).

The VMS version does not set the file time.

At high speeds,
VMS sometimes loses incoming characters, resulting in retries
and degradation of throughput.

The mysterious
VMS C Standard I/O Package and RMS may interact to modify
file contents unexpectedly.

The VMS version does not support invocation as
.B rzCOMMAND .
ZMODEM has not yet been implemented on the VMS version.
.SH "ZMODEM CAPABILITIES"
.I Rz
supports incoming ZMODEM binary (-b), ASCII (-a),
protect (-p),
and append (-+)
requests, and ZMODEM command execution.
.SH FILES
rz.c, rbsb.c, zm.c, zmodem.h source files.

/tmp/rzlog stores debugging output generated with -vv option.
