w8sdz@brl-smoke.ARPA (Keith B. Petersen ) (04/28/88)
Since some users do not have any way to create man pages from the *.1 files in Chuck Forsberg's 23-Apr-88 Zmodem release, I am including them here. ---- Cut Here and unpack ---- #!/bin/sh # shar: Shell Archiver (v1.18) # # Run the following text with /bin/sh to create: # crc.man # minirb.man # rz.man # sz.man # if test -f crc.man; then echo "File crc.man exists"; else echo "x - extracting crc.man (Text)" sed 's/^X//' << 'SHAR_EOF' > crc.man && X X X XCRC(1) UNIX Programmer's Manual CRC(1) X X X XNAME X crc - checksum files X XSYNOPSIS X crc file ... X XDESCRIPTION X For each file, crc calculates and prints a 32-bit CRC, the X byte count, and the file name. It is typically used to X validate files transferred between different systems, and is X useful in detecting subtle disk corruption. Crc uses a X checksum compatible with the DOS version of crc, as well as X the "crc" command in ZCOMM and Professional-YAM (high relia- X bility communications programs). X X The 32-bit CRC used is the frame check sequence in ADCCP X (ANSI X3.66, also known as FIPS PUB 71 and FED-STD-1003, the X U.S. versions of CCITT's X.25 link-level protocol). X X 32 bit CRC code courtesy Gary S. Brown. X XBUGS X Although most unlikely, files with different data may still X produce the same crc value. X XSEE ALSO X chek(1), tocpm(1), sum(1), wc(1). X X X X X X X X X X X X X X X X X X X X X X X X X X X X XPrinted 4/28/88 OMEN 1 X X X SHAR_EOF chmod 0644 crc.man || echo "restore of crc.man fails" fi if test -f minirb.man; then echo "File minirb.man exists"; else echo "x - extracting minirb.man (Text)" sed 's/^X//' << 'SHAR_EOF' > minirb.man && X X X XMINIRB(1) UNIX Programmer's Manual MINIRB(1) X X X XNAME X minirb - Bootstrap YMODEM Batch file receive X XSYNOPSIS X minirb X XDESCRIPTION X Minirb receives one or more files with YMODEM batch file X transfer protocol. Minirb was developed for use as a X bootstrap to simplify uploading of the longer rz and sz pro- X grams, such as are contained in the rzsz.zoo "zoo" archive X or the rzsz.sh shell archive. X XSEE ALSO X YMODEM.DOC, Professional-YAM manual, sz(omen) X XNOTES X The source file minirb.c has been ruthlessly pruned (4k, 175 X lines) to simplify uploading without benefit of an error X correcting file transfer protocol. Do not reformat or add X tabs to the source file as this would complicate uploading. X X Please read the uploading suggestions in the chapter File X Transfer Basics in the Professional-YAM or ZCOMM user's X manual. X X Minirb uses 8 bit checksum which may not be compatible with X some programs claiming to support YMODEM batch transfers. X X Minirb uses the YMODEM header file length information to X avoid storing extraneous characters. Minirb deletes car- X riage returns and CPMEOF (^Z) characters encountered in X uploaded files. X X Minirb calls stty(1) to set and reset raw tty mode. X X X X X X X X X X X X X X X X X X X X XPrinted 4/28/88 OMEN 1 X X X SHAR_EOF chmod 0644 minirb.man || echo "restore of minirb.man fails" fi if test -f rz.man; then echo "File rz.man exists"; else echo "x - extracting rz.man (Text)" sed 's/^X//' << 'SHAR_EOF' > rz.man && X X X XRZ(1) UNIX Programmer's Manual RZ(1) X X X XNAME X rx, rb, rz - XMODEM, YMODEM, ZMODEM (Batch) file receive X XSYNOPSIS X rz [- +abepqtuvy] X rb [- +abqtuvy] X rx [- abceqtuv] file X gz file ... X [-][v]rzCOMMAND X XDESCRIPTION X This program uses error correcting protocols to receive X files over a dial-in serial port from a variety of programs X running under PC-DOS, CP/M, Unix, and other operating sys- X tems. It is invoked from a shell prompt manually, or X automatically as a result of an "sz file ..." command given X to the calling program. X X While rz is smart enough to be called from cu(1), very few X versions of cu(1) are smart enough to allow rz to work prop- X erly. Unix flavors of Professional-YAM are available for X such dial-out application. X X X Rz (Receive ZMODEM) receives files with the ZMODEM batch X protocol. Pathnames are supplied by the sending program, X and directories are made if necessary (and possible). Nor- X mally, the "rz" command is automatically issued by the cal- X ling ZMODEM program, but some defective ZMODEM implementa- X tions may require starting rz the old fashioned way. X X X Rb receives file(s) with YMODEM, accepting either standard X 128 byte sectors or 1024 byte sectors (YAM sb -k option). X The user should determine when the 1024 byte block length X actually improves throughput without causing lost data or X even system crashes. X X If True YMODEM (Omen Technology trademark) file information X (file length, etc.) is received, the file length controls X the number of bytes written to the output dataset, and the X modify time and file mode (iff non zero) are set accord- X ingly. X X If no True YMODEM file information is received, slashes in X the pathname are changed to underscore, and any trailing X period in the pathname is eliminated. This conversion is X useful for files received from CP/M systems. With YMODEM, X each file name is converted to lower case unless it contains X one or more lower case letters. X X X X X XPrinted 4/28/88 OMEN 1 X X X X X X XRZ(1) UNIX Programmer's Manual RZ(1) X X X X Rx receives a single file with XMODEM or XMODEM-1k protocol. X The user should determine when the 1024 byte block length X actually improves throughput without causing problems. The X user must supply the file name to both sending and receiving X programs. Up to 1023 garbage characters may be added to the X received file. X X Gz is a shell script which calls sz to command Pro-YAM or X ZCOMM to transmit the specified files. Pathnames used with X gz must be escaped if they have special significance to the X Unix shell. X EXAMPLE: gz "-a C:*.c D:*.h" X X X Rz may be invoked as rzCOMMAND (with an optional leading - X as generated by login(1)). For each received file, rz will X pipe the file to ``COMMAND filename'' where filename is the X name of the transmitted file with the file contents as stan- X dard input. X X Each file transfer is acknowledged when COMMAND exits with 0 X status. A non zero exit status terminates transfers. X X A typical use for this form is rzrmail which calls rmail(1) X to post mail to the user specified by the transmitted file X name. For example, sending the file "caf" from a PC-DOS X system to rzrmail on a Unix system would result in the con- X tents of the DOS file "caf" being mailed to user "caf". X X On some Unix systems, the login directory must contain a X link to COMMAND as login sets SHELL=rsh which disallows X absolute pathnames. If invoked with a leading ``v'', rz X will report progress to /tmp/rzlog. The following entry X works for Unix SYS III/V: X rzrmail::5:1::/bin:/usr/local/rzrmail X If the SHELL environment variable includes rsh or rksh (res- X tricted shell), rz will not accept absolute pathnames or X references to a parent directory, will not modify an exist- X ing file, and removes any files received in error. X X If rz is invoked with stdout and stderr to different X datasets, Verbose is set to 2, causing frame by frame pro- X gress reports to stderr. This may be disabled with the q X option. X X X The meanings of the available options are: X X a Convert files to Unix conventions by stripping carriage X returns and all characters beginning with the first X Control Z (CP/M end of file). X b Binary (tell it like it is) file transfer override. X X X XPrinted 4/28/88 OMEN 2 X X X X X X XRZ(1) UNIX Programmer's Manual RZ(1) X X X X c Request 16 bit CRC. XMODEM file transfers default to 8 X bit checksum. YMODEM and ZMODEM normally use 16 bit X CRC. X D Output file data to /dev/null; for testing. (Unix X only) X e Force sender to escape all control characters; normally X XON, XOFF, DLE, CR-@-CR, and Ctrl-X are escaped. X p (ZMODEM) Protect: skip file if destination file exists. X q Quiet suppresses verbosity. X t tim X Change timeout to tim tenths of seconds. X v Verbose causes a list of file names to be appended to X /tmp/rzlog . More v's generate more output. X y Yes, clobber any existing files with the same name. X XEXAMPLES X (Pro-YAM command) X <ALT-2> X Pro-YAM Command: sz *.h *.c X (This automatically invokes rz on the connected system.) X XSEE ALSO X ZMODEM.DOC, YMODEM.DOC, Professional-YAM, crc(omen), X sz(omen), usq(omen), undos(omen) X X Compile time options required for various operating systems X are described in the source file. X XNOTES X Sending serial data to timesharing minicomputers at sus- X tained high speeds has been known to cause lockups, system X halts, kernel panics, and occasional antisocial behaviour. X When experimenting with high speed input to a system, con- X sider rebooting the system if the file transfers are not X successful, especially if the personality of the system X appears altered. X X The Unix "ulimit" parameter must be set high enough to per- X mit large file transfers. X X The TTY input buffering on some systems may not allow long X blocks or streaming input at high speed. You should suspect X this problem when you can't send data to the Unix system at X high speeds using ZMODEM, YMODEM-1k or XMODEM-1k, when YMO- X DEM with 128 byte blocks works properly. If the system's X tty line handling is really broken, the serial port or the X entire system may not survive the onslaught of long bursts X of high speed data. X X The DSZ or Pro-YAM zmodem l numeric parameter may be set to X a value between 64 and 1024 to limit the burst length ("zmo- X dem pl128"). X X X XPrinted 4/28/88 OMEN 3 X X X X X X XRZ(1) UNIX Programmer's Manual RZ(1) X X X X 32 bit CRC code courtesy Gary S. Brown. Directory creation X code from John Gilmore's PD TAR program. X XBUGS X Calling rz from most versions of cu(1) doesn't work because X cu's receive process fights rz for characters from the X modem. X X Programs that do not properly implement the specified file X transfer protocol may cause sz to "hang" the port for a X minute or two. Every reported instance of this problem has X been corrected by using ZCOMM, Pro-YAM, or other program X with a correct implementation of the specified protocol. X X Many programs claiming to support YMODEM only support XMODEM X with 1k blocks, and they often don't get that quite right. X X Pathnames are restricted to 127 characters. In XMODEM sin- X gle file mode, the pathname given on the command line is X still processed as described above. The ASCII option's X CR/LF to NL translation merely deletes CR's; undos(omen) X performs a more intelligent translation. X XVMS VERSION X The VMS version does not set the file time. X X VMS C Standard I/O and RMS may interact to modify file con- X tents unexpectedly. X X The VMS version does not support invocation as rzCOMMAND . X The current VMS version does not support XMODEM, XMODEM-1k, X or YMODEM. X X According to the VMS documentation, the buffered input rou- X tine used on the VMS version of rz introduces a delay of up X to one second for each protocol transaction. This delay may X be significant for very short files. Removing the "#define X BUFREAD" line from rz.c will eliminate this delay at the X expense of increased CPU utilization. X X The VMS version causes DCL to generate a random off the wall X error message under some error conditions; this is a result X of the incompatibility of the VMS "exit" function with the X Unix/MSDOS standard. X XZMODEM CAPABILITIES X Rz supports incoming ZMODEM binary (-b), ASCII (-a), protect X (-p), clobber (-y), and append (-+) requests. The default X is protect (-p) and binary (-b). X X The Unix versions support ZMODEM command execution. X X X X XPrinted 4/28/88 OMEN 4 X X X X X X XRZ(1) UNIX Programmer's Manual RZ(1) X X X XFILES X rz.c, crctab.c, rbsb.c, zm.c, zmodem.h Unix source files. X X rz.c, crctab.c, vrzsz.c, zm.c, zmodem.h, vmodem.h, X vvmodem.c, VMS source files. X X /tmp/rzlog stores debugging output generated with -vv option X (rzlog on VMS). X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X XPrinted 4/28/88 OMEN 5 X X X SHAR_EOF chmod 0644 rz.man || echo "restore of rz.man fails" fi if test -f sz.man; then echo "File sz.man exists"; else echo "x - extracting sz.man (Text)" sed 's/^X//' << 'SHAR_EOF' > sz.man && X X X XSZ(1) UNIX Programmer's Manual SZ(1) X X X XNAME X sx, sb, sz - XMODEM, YMODEM, ZMODEM file send X XSYNOPSIS X sz [-+abdefkLlNnopqTtuvyY] file ... X sb [-adfkqtuv] file ... X sx [-akqtuv] file X sz [-oqtv] -c COMMAND X sz [-oqtv] -i COMMAND X sz -TT X XDESCRIPTION X Sz uses the ZMODEM, YMODEM or XMODEM error correcting proto- X col to send one or more files over a dial-in serial port to X a variety of programs running under PC-DOS, CP/M, Unix, VMS, X and other operating systems. X X While rz is smart enough to be called from cu(1), very few X versions of cu(1) are smart enough to allow sz to work prop- X erly. Unix flavors of Professional-YAM are available for X such dial-out application. X X X Sz sends one or more files with ZMODEM protocol. X X ZMODEM greatly simplifies file transfers compared to XMODEM. X In addition to a friendly user interface, ZMODEM provides X Personal Computer and other users an efficient, accurate, X and robust file transfer method. X X ZMODEM provides complete END-TO-END data integrity between X application programs. ZMODEM's 32 bit CRC catches errors X that sneak into even the most advanced networks. X X Advanced file management features include AutoDownload X (Automatic file Download initiated without user interven- X tion), Display of individual and total file lengths and X transmission time estimates, Crash Recovery, selective file X transfers, and preservation of exact file date and length. X X Output from another program may be piped to sz for transmis- X sion by denoting standard input with "-": X ls -l | sz - X The program output is transmitted with the filename sPID.sz X where PID is the process ID of the sz program. If the X environment variable ONAME is set, that is used instead. In X this case, the Unix command: X ls -l | ONAME=con sz -ay - X will send a "file" to the PC-DOS console display. The -y X option instructs the receiver to open the file for writing X unconditionally. The -a option causes the receiver to con- X vert Unix newlines to PC-DOS carriage returns and linefeeds. X X X XPrinted 4/28/88 OMEN 1 X X X X X X XSZ(1) UNIX Programmer's Manual SZ(1) X X X X Sb batch sends one or more files with YMODEM or ZMODEM pro- X tocol. The initial ZMODEM initialization is not sent. When X requested by the receiver, sb supports YMODEM-g with X "cbreak" tty mode, XON/XOFF flow control, and interrupt X character set to CAN (^X). YMODEM-g (Professional-YAM g X option) increases throughput over error free channels X (direct connection, X.PC, etc.) by not acknowledging each X transmitted sector. X X On Unix systems, additional information about the file is X transmitted. If the receiving program uses this informa- X tion, the transmitted file length controls the exact number X of bytes written to the output dataset, and the modify time X and file mode are set accordingly. X X X Sx sends a single file with XMODEM or XMODEM-1k protocol X (sometimes incorrectly called "ymodem"). The user must sup- X ply the file name to both sending and receiving programs. X X Iff sz is invoked with $SHELL set and iff that variable con- X tains the string rsh or rksh (restricted shell), sz operates X in restricted mode. Restricted mode restricts pathnames to X the current directory and PUBDIR (usually X /usr/spool/uucppublic) and/or subdirectories thereof. X X X The fourth form sends a single COMMAND to a ZMODEM receiver X for execution. Sz exits with the COMMAND return value. If X COMMAND includes spaces or characters special to the shell, X it must be quoted. X X X The fifth form sends a single COMMAND to a ZMODEM receiver X for execution. Sz exits as soon as the receiver has X correctly received the command, before it is executed. X X X The sixth form (sz -TT) attempts to output all 256 code com- X binations to the terminal. In you are having difficulty X sending files, this command lets you see which character X codes are being eaten by the operating system. X X X If sz is invoked with stdout and stderr to different X datasets, Verbose is set to 2, causing frame by frame pro- X gress reports to stderr. This may be disabled with the q X option. X X The meanings of the available options are: X X X X X XPrinted 4/28/88 OMEN 2 X X X X X X XSZ(1) UNIX Programmer's Manual SZ(1) X X X X \h@|120u+0u@(Reg.)(VMS) Force the next option letter to X upper case. X + Instruct the receiver to append transmitted data to an X existing file (ZMODEM only). X a Convert NL characters in the transmitted file to CR/LF. X This is done by the sender for XMODEM and YMODEM, by X the receiver for ZMODEM. X b (ZMODEM) Binary override: transfer file without any X translation. X c COMMAND X Send COMMAND to the receiver for execution, return with X COMMAND's exit status. X d Change all instances of "." to "/" in the transmitted X pathname. Thus, C.omenB0000 (which is unacceptable to X MSDOS or CP/M) is transmitted as C/omenB0000. If the X resultant filename has more than 8 characters in the X stem, a "." is inserted to allow a total of eleven. X e Escape all control characters; normally XON, XOFF, DLE, X CR-@-CR, and Ctrl-X are escaped. X f Send Full pathname. Normally directory prefixes are X stripped from the transmitted filename. X i COMMAND X Send COMMAND to the receiver for execution, return X Immediately upon the receiving program's successful X recption of the command. X k (XMODEM/YMODEM) Send files using 1024 byte blocks X rather than the default 128 byte blocks. 1024 byte X packets speed file transfers at high bit rates. (ZMO- X DEM streams the data for the best possible throughput.) X L N Use ZMODEM sub-packets of length N. A larger N (32 <= X N <= 1024) gives slightly higher throughput, a smaller X N speeds error recovery. The default is 128 below 300 X baud, 256 above 300 baud, or 1024 above 2400 baud. X l N Wait for the receiver to acknowledge correct data every X N (32 <= N <= 1024) characters. This may be used to X avoid network overrun when XOFF flow control is lack- X ing. X n (ZMODEM) Send each file if destination file does not X exist. Overwrite destination file if source file is X newer than the destination file. X N (ZMODEM) Send each file if destination file does not X exist. Overwrite destination file if source file is X newer or longer than the destination file. X o (ZMODEM) Disable automatic selection of 32 bit CRC. X p (ZMODEM) Protect existing destination files by skipping X transfer if the destination file exists. X q Quiet suppresses verbosity. X r (ZMODEM) Resume interrupted file transfer. If the X source file is longer than the destination file, the X transfer commences at the offset in the source file X that equals the length of the destination file. X t tim X X X XPrinted 4/28/88 OMEN 3 X X X X X X XSZ(1) UNIX Programmer's Manual SZ(1) X X X X Change timeout to tim tenths of seconds. X u Unlink the file after successful transmission. X w N Limit the transmit window size to N bytes (ZMODEM). X v Verbose causes a list of file names to be appended to X /tmp/szlog . More v's generate more output. X y Instruct a ZMODEM receiving program to overwrite any X existing file with the same name. X Y Instruct a ZMODEM receiving program to overwrite any X existing file with the same name, and to skip any X source files that do have a file with the same pathname X on the destination system. X XEXAMPLES X ZMODEM File Transfer (Unix to DSZ/ZCOMM/Professional-YAM) X % sz -a *.c X This single command transfers all .c files in the current X Unix directory with conversion (-a) to end of line conven- X tions appropriate to the receiving environment. With ZMODEM X AutoDownload enabled, Professional-YAM and ZCOMM will X automatically recieve the files after performing a security X check. X X % sz -Yan *.c *.h X Send only the .c and .h files that exist on both systems, X and are newer on the sending system than the corresponding X version on the receiving system, converting Unix to DOS text X format. X $ sz -\Yan file1.c file2.c file3.c foo.h baz.h (Reg.)(for X VMS) X X ZMODEM Command Download (Unix to Professional-YAM) X cpszall:all X sz -c "c:;cd /yam/dist" X sz -ya $(YD)/*.me X sz -yqb y*.exe X sz -c "cd /yam" X sz -i "!insms" X This Makefile fragment uses sz to issue commands to X Professional-YAM to change current disk and directory. X Next, sz transfers the .me files from the $YD directory, X commanding the receiver to overwrite the old files and to X convert from Unix end of line conventions to PC-DOS conven- X tions. The third line transfers some .exe files. The X fourth and fifth lines command Pro-YAM to change directory X and execute a PC-DOS batch file insms . Since the batch file X takes considerable time, the -i form is used to allow sz to X exit immediately. X X XMODEM File Transfer (Unix to Crosstalk) X % sx -a foo.c X ESC X rx foo.c X X X XPrinted 4/28/88 OMEN 4 X X X X X X XSZ(1) UNIX Programmer's Manual SZ(1) X X X X The above three commands transfer a single file from Unix to X a PC and Crosstalk with sz translating Unix newlines to DOS X CR/LF. This combination is much slower and far less reli- X able than ZMODEM. X XERROR MESSAGES X "Caught signal 99" indicates the program was not properly X compiled, refer to "bibi(99)" in rbsb.c for details. X XSEE ALSO X rz(omen), ZMODEM.DOC, YMODEM.DOC, Professional-YAM, X crc(omen), sq(omen), todos(omen), tocpm(omen), tomac(omen), X yam(omen) X X Compile time options required for various operating systems X are described in the source file. X XVMS VERSION X The VMS version does not support wild cards. Because of VMS X DCL, upper case option letters muse be represented by \ X proceding the letter. X X The current VMS version does not support XMODEM, XMODEM-1k, X or YMODEM. X X VMS C Standard I/O and RMS may interact to modify the file X contents. X XFILES X 32 bit CRC code courtesy Gary S. Brown. X X sz.c, crctab.c, rbsb.c, zm.c, zmodem.h Unix source files X X sz.c, crctab.c, vrzsz.c, zm.c, zmodem.h, vmodem.h, X vvmodem.c, VMS source files. X X /tmp/szlog stores debugging output (sz -vv) (szlog on VMS). X XTESTING FEATURE X The command "sz -T file" exercises the Attn sequence error X recovery by commanding errors with unterminated packets. X The receiving program should complain five times about X binary data packets being too long. Each time sz is inter- X rupted, it should send a ZDATA header followed by another X defective packet. If the receiver does not detect five long X data packets, the Attn sequence is not interrupting the X sender, and the Myattn string in sz.c must be modified. X X After 5 packets, sz stops the "transfer" and prints the X total number of characters "sent" (Tcount). The difference X between Tcount and 5120 represents the number of characters X stored in various buffers when the Attn sequence is X X X XPrinted 4/28/88 OMEN 5 X X X X X X XSZ(1) UNIX Programmer's Manual SZ(1) X X X X generated. X XBUGS X Calling sz from most versions of cu(1) doesn't work because X cu's receive process fights sz for characters from the X modem. X X Programs that do not properly implement the specified file X transfer protocol may cause sz to "hang" the port for a X minute or two. Every reported instance of this problem has X been corrected by using ZCOMM, Pro-YAM, or other program X with a correct implementation of the specified protocol. X X Many programs claiming to support YMODEM only support XMODEM X with 1k blocks, and they often don't get that quite right. X X XMODEM transfers add up to 127 garbage bytes per file. X XMODEM-1k and YMODEM-1k transfers use 128 byte blocks to X avoid extra padding. X X YMODEM programs use the file length transmitted at the X beginning of the transfer to prune the file to the correct X length; this may cause problems with source files that grow X during the course of the transfer. This problem does not X pertain to ZMODEM transfers, which preserve the exact file X length unconditionally. X X Most ZMODEM options are merely passed to the receiving pro- X gram; some do not implement all these options. X X Circular buffering and a ZMODEM sliding window should be X used when input is from pipes instead of acknowledging X frames each 1024 bytes. If no files can be opened, sz sends X a ZMODEM command to echo a suitable complaint; perhaps it X should check for the presence of at least one accessible X file before getting hot and bothered. The test mode leaves X a zero length file on the receiving system. X X A few high speed modems have a firmware bug that drops char- X acters when the direction of high speed transmissson is X reversed. The environment variable ZNULLS may be used to X specify the number of nulls to send before a ZDATA frame. X Values of 101 for a 4.77 mHz PC and 124 for an AT are typi- X cal. X X X X X X X X X X X XPrinted 4/28/88 OMEN 6 X X X SHAR_EOF chmod 0644 sz.man || echo "restore of sz.man fails" fi exit 0 -- Keith Petersen Arpa: W8SDZ@SIMTEL20.ARPA Uucp: {bellcore,decwrl,harvard,lll-crg,ucbvax,uw-beaver}!simtel20.arpa!w8sdz GEnie: W8SDZ