CCTR SZ, Zmodem Send


| Site | Docs | Ref | Resources | Community   | FeedBack |
| Mail | Web | Software | Classes | FAQs |

     NAME
          sz - ZMODEM file send
          zcommand, zcommandi - ZMODEM command download

     SYNOPSIS
          sz [-+abdEefgIikLlMmNnoPpqtuvxyYZ] file ...
          zcommand [-oqtv] COMMAND
          zcommandi [-oqtv] COMMAND
          sz -T

     DESCRIPTION
          This set of commands uses the ZMODEM, YMODEM or XMODEM error
          correcting protocol to send files to a program logged into a
          serial port.  (See NETWORK NOTES, below.)


          This version of sz operates with Omen Technology products,
          and is licensed only for use therewith.

          Commercial sz and rz for use with any program supporting
          XMODEM, YMODEM, or ZMODEM are available for purchase from
          Omen Technology INC.

          The program is not designed be called from cu, tip, kermit,
          or any other communications program.  Unix flavors of Omen
          Technology's Professional-YAM communications software are
          available for dial-out applications.


          Sz sends one or more files with ZMODEM protocol.




          Zcommand sends a single COMMAND to a ZMODEM receiver for
          execution.  Zcommand exits with the COMMAND return value.
          If COMMAND includes spaces or characters special to the
          shell, it must be quoted.


          Zcommandi sends a single COMMAND to a ZMODEM receiver for
          execution.  Zcommandi exits as soon as the receiver has
          correctly received the command, before it is executed.


          The sixth form (sz -T) outputs all 256 code combinations to
          the terminal.  The hex value of the character, a space, and
          the raw character are sent, 8 per line.  In you are having
          difficulty sending files, this command lets you see which
          character codes are being eaten or corrupted by the
          operating system or network.  The terminal program must be
          set to display all 256 codes in a distinct form.  Check that
          each code is sent, and that the 8th bit on codes 0x80 to
          0xFF is set.

          Sz -T then allows the caller to input characters which are
          echoed in hex.  You should check that all control characters
          can be input this way.


          The meanings of the available options are:

          \    (backslash) (VMS) Force the next option letter to upper
               case.
          +    Instruct the receiver to append transmitted data to an
               existing file (ZMODEM only).
          a    Instruct the ZMODEM receiver to convert text file
               format as appropriate for the receiving system.  When
               sending to a PC-DOS system, the receiving ZMODEM
               program converts END OF LINE to a CR/LF pair.
          b    (ZMODEM) Binary override: transfer file without any
               translation.
          bb   (bogus binary) On VMS reads disk files with an
               alternate mode.  Suitable for a few strange file types
               such as Lotus .wk3 spreadsheet files.
          d    Change all instances of "." to "/" in the transmitted
               pathname.  Thus, C.omenB0000 (which is unacceptable to
               MSDOS or CP/M) is transmitted as C/omenB0000.  If the
               resultant filename has more than 8 characters in the
               stem, a "." is inserted to allow a total of eleven.
          e    Escape all control characters; normally XON, XOFF, DLE,
               CR-@-CR, and Ctrl-X are escaped.
          E    Escape the 8th bit to allow operation over 7 bit paths.
               Witnout the P option, data is compressed.
          EP   Pack 4 data bytes into 5 bytes for operation over 7 bit
               paths.  This is more efficient when the data is already
               compressed.
          f    Send Full pathname.  Normally directory prefixes are
               stripped from the transmitted filename.
          ff   Send Full VMS pathname including device name and
               version number.
          g    Send ESC-[-?-3-4-l to start DSZ from Kermit.
          i    Make VMS receiver use Stream_LF record format to avoid
               padding file with nulls.  This record format is
               understood by many C programs.
          I    Make VMS receiver use Variable length (mrs=510) image
               record format to avoid padding file with nulls.  This
               binary record format is understood by many Kermit
               programs.
          LN   Use ZMODEM sub-packets of length N.  A larger N (32 <=
               N <= 1024) gives slightly higher throughput, a smaller
               N speeds error recovery.  The default is 128 below 300
               baud, 256 above 300 baud, or 1024 above 2400 baud.
          lN   Wait for the receiver to acknowledge correct data every
               N (32 <= N <= 1024) characters.  This may be used to
               avoid network overrun when XOFF flow control is
               lacking.
          m    Request MobyTurboTm throughput enhancement.
          M    Lock out MobyTurboTm throughput enhancement.
          n    (ZMODEM) Send each file if destination file does not
               exist.  Overwrite destination file if source file is
               newer than the destination file.
          N    (ZMODEM) Send each file if destination file does not
               exist.  Overwrite destination file if source file is
               newer or longer than the destination file.
          o    (ZMODEM) Disable automatic selection of 32 bit CRC.
          p    (ZMODEM) Protect existing destination files by skipping
               transfer if the destination file exists.
          q    When sz starts up, sz counts the files to be sent and
               totals their lengths.  This information allows the
               receiver to display the progress in a multiple file
               (batch) transmission.  When many files are specified
               (as with wild cards) this takes some time.  The q
               (quiet) option bypasses this count.
          r    (ZMODEM) Resume interrupted file transfer.  If the
               source file is longer than the destination file, the
               transfer commences at the offset in the source file
               that equals the length of the destination file.
          rr   As above, but compares the files (the portion common to
               sender and receiver) before resuming the transfer.
          ttim Change timeout to tim tenths of seconds.
          u    Unlink the file after successful transmission.  Users
               should not manually abort or skip file transfers when
               this option is used.
          wN   Limit the transmit window size to N bytes (ZMODEM).
               The sz program will interrogate the receiver and pause
               if necessary to let the receiver catch up to within the
               specified window size.  This option is useful when
               sending long files over networks that time out if the
               user does not enter commands frequently.
          v    Verbose causes a list of file names to be appended to
               /tmp/szlog (szlog.tmp on VMS).  More v's generate more
               detailed output.
          x    Count skipped files as errors.
          y    Instruct a ZMODEM receiving program to overwrite any
               existing file with the same name.
          Y    Instruct a ZMODEM receiving program to overwrite any
               existing file with the same name, and to skip any
               source files that do have a file with the same pathname
               on the destination system.
          Z    Use ZMODEM file compression to speed file transfer.

     DIAGNOSTICS
          Exit status is as follows: 0 for successful transfers.  1 if
          unrecoverable errors are detected.  2 if syntax errors or
          file access problems are detected.  3 if the program was
          terminated by a caught interrupt.

     EXAMPLES
          ZMODEM File Transfer (Unix to DSZ/ZCOMM/Professional-YAM)
          % sz -a *.c
          This single command transfers all .c files in the current
          Unix directory with conversion (-a) to end of line
          conventions appropriate to the receiving environment.  With
          ZMODEM AutoDownload enabled, Professional-YAM  and ZCOMM
          will automatically receive the files after performing a
          security check.

          % sz -Yan *.c *.h
          Send only the .c and .h files that exist on both systems,
          and are newer on the sending system than the corresponding
          version on the receiving system, converting Unix to DOS text
          format.
          $ sz "-Yan" file1.c file2.c file3.c foo.h baz.h (for VMS)

          ZMODEM Command Download (Unix to Professional-YAM)
           cpszall:all
              zcommand "c:;cd /yam/dist"
              sz -ya $(YD)/*.me
              sz -yqb y*.exe
              zcommand "cd /yam"
              zcommandi "!insms"
          This Makefile fragment uses zcommand to issue commands to
          Professional-YAM to change current disk and directory.
          Next, sz transfers the .me files from the $YD directory,
          commanding the receiver to overwrite the old files and to
          convert from Unix end of line conventions to PC-DOS
          conventions.  The third line transfers some .exe files.  The
          fourth and fifth lines command Pro-YAM to change directory
          and execute a PC-DOS batch file insms . Since the batch file
          takes considerable time, zcommandi form is used to allow sz
          to exit immediately.

          XMODEM File Transfer (Unix to Crosstalk)
          % sx foo.c
          ESC
          rx foo.c
          The above three commands transfer a single file from Unix to
          a PC and Crosstalk.  This combination is much slower and
          less reliable under stress than ZMODEM.

     NOTES
          ZMODEM greatly simplifies file transfers compared to XMODEM.
          In addition to a friendly user interface, ZMODEM provides
          Personal Computer and other users an efficient, accurate,
          and robust file transfer method.

          ZMODEM provides complete END-TO-END data integrity between
          application programs.  ZMODEM's 32 bit CRC catches errors
          that sneak into even the most advanced networks.

          Advanced file management features include AutoDownload
          (Automatic file Download initiated without user
          intervention), Display of individual and total file lengths
          and transmission time estimates, Crash Recovery, selective
          file transfers, and preservation of exact file date and
          length.

          The -y option instructs the receiver to open the file for
          writing unconditionally.  The -a option causes the receiver
          to convert Unix newlines or VMS variable length records to
          the receiving system's standard text format (carriage
          returns and linefeeds for PC-DOS).

          On VMS and Unix systems, sz and sb send the length and date
          of each file.  If the receiving program uses this
          information, the transmitted file length controls the exact
          number of bytes written to the output dataset, and the
          modify time and file mode are set accordingly.


     SERVER/NETWORK NOTES
          Terminals on some timesharing systems are connected
          indirectly to the host with TERMINAL SERVERS operating over
          networks.  Terminal servers often interfere with file
          transfers by "eating" control characters and/or losing data.

          When terminal servers interfere with file transfers, server
          commands are often available to help the problem.  When
          possible, enable the server and modems for hardware flow
          control in and out.  Set the terminal server to telnet
          transparent mode.  Some typical commands are "SET TERMINAL
          DOWNLOAD", "set session passall", and "SET TERMINAL NO ESC",
          but there is no standard set of commands suitable for all
          terminal servers.  Normally these commands are given before
          attempting file transfers, but one user has reported that
          the command must be given after the file transfer is
          started(!).  Until terminal server vendors improve the
          quality of their product, you may have to get on their case
          until they adequately support high performance file
          transfers.

          Escaping control characters (sz -e) may help if the transfer
          gets stuck in the same place on every attempt.
          Professional-YAM and ZCOMM allow selection of which control
          characters need to be escaped.  In extreme cases 7-bit
          transmission may be required (see the Professional-YAM/ZCOMM
          manual).

          If you encounter problems with control characters Please
          refer to the sz -T command in sz.doc for more help.

          Flow control between the server and modem is often
          defective.  This rarely causes a problem in interactive
          applications whose short bursts (a screenfull at most) fit
          within the available memory buffers.  Streaming protocols
          such as YMODEM-g, long packet SuperKermit, and ZMODEM can
          overload the available buffering.  Some terminal servers
          support commands to enable hardware flow control such as
          "TERM FLOWCONTROL HARDWARE IN OUT"; this assumes the modem
          attached to the server is properly configured.

          If the terminal server is too brain damaged to support flow
          control, you can fake it with ZMODEM.  Try
               sz -w1024 file...
          to enable software flow control. Experiment with different
          values to find the best throughput.

          Terminal servers are designed to accept keyboard input from
          human operators.  They may lose data when a program sends
          data to the host faster than humans type.  Some servers
          allow larger input buffers to support file uploads.  If you
          can upload short files (less than 100 bytes) but not longer
          files, try
               sz -w1024 file...
          with your uploading program.  (Not all programs support this
          option; use ZCOMM or Professional-YAM.)

          When both flow control and character transparency are
          problems, use
               sz -ew1024 file...
          as a starting point.

          Sometimes the terminal server software is defective and must
          be upgraded.  Please contact the network's vendor for
          corrective procedures.  An alternative is to install direct
          serial ports for users desiring to upload files.

          Some systems enforce a timeout which disconnects a user
          after several minutes of no keyboarding.  This can cause
          problems in long, error free ZMODEM transfers.  Restricting
          the window size with a "-w8192" option provides terminal
          input at regular intervals even when no error correction is
          needed.  If problems persist, try setting a packet length.
               sz -l1024 file...
          (The default ZMODEM packet length is the file length.)

     SEE ALSO
          Professional-YAM, rz(omen), crc(omen), sq(omen),
          todos(omen), tocpm(omen), tomac(omen)

     VMS NOTES
          To use sz a DCL verb must be defined with syntax similar to
          the following:
          sz :== "$disk$user2:[username.subdir]sz.exe sz"
          For example, if "dir sz" results in:
          Directory SYS$SYSDEVICE:[CAF]
          SZ.EXE;41
          then you should define sz:
          $sz :== "$sys$sysdevice:[CAF]vsz.exe sz"

          Other verbs are:
          $zcommand  :== "$sys$sysdevice:[CAF]vsz.exe zcommand"
          $zcommandi :== "$sys$sysdevice:[CAF]vsz.exe zcommandi"

          Wild cards are expanded within sz.
          sz -a [*...]*.h sends all accessible .h files in the system.

          VMS DCL forces command line arguments to upper case unless
          they are enclosed by double quotes.  Upper case option
          letters may be represented by preceding the letter with \.

          VMS C Standard I/O and RMS may interact to modify the file
          contents.  File lengths are not accurately reported for some
          VMS record formats; When files are sent with XMODEM or
          YMODEM, file length is measured by counting the characters
          therein.

          For efficient operation at high baud rates, the system
          manager should "set term tta0:/altypeahd/perm" (choose the
          appropriate tty port).  This must be done when the
          particular terminal line is not logged in.  Without setting
          altypeahd you may get excessive retries and/or lousy
          throughput.

          In addition the system manager can try increasing the SYSGEN
          parameter TTY_TYPAHDSZ to, say, 2048 or more.

          In order to get the maximum speed the process quotas
          buffered I/O byte count should be 30000 or more and buffered
          I/O limit should be 100 or more.

          To see what you have type:
          $ show process/quotas

          To change this type:
          $ set default sys$system
          $ run authorize
          modify/BIOlm=100/Bytlm=30000 caf       (or whatever your
          username is)
          exit

          Now log out and log back in to get the new quotas.

     UNIX NOTES
          Iff sz is invoked with $SHELL set and iff that variable
          contains the string rsh or rksh (restricted shell), sz
          operates in restricted mode.  Restricted mode restricts
          pathnames to the current directory and PUBDIR (usually
          /usr/spool/uucppublic) and/or subdirectories thereof.


     FILES
          /tmp/szlog stores debugging output (sz -vv) (SZLOG.TMP on
          VMS).

          32 bit CRC code courtesy Gary S. Brown.

     TESTING FEATURE
          The command "sz -T file" exercises the Attn sequence error
          recovery by commanding errors with unterminated packets.
          The receiving program should complain five times about
          binary data packets being too long.  Each time sz is
          interrupted, it should send a ZDATA header followed by
          another defective packet.  If the receiver does not detect
          five long data packets, the Attn sequence is not
          interrupting the sender, and the Myattn string in sz.c must
          be modified.

          After 5 packets, sz stops the "transfer" and prints the
          total number of characters "sent" (Tcount).  The difference
          between Tcount and 5120 represents the number of characters
          stored in various buffers when the Attn sequence is
          generated.

     NOTES
          Sz is not designed be called from cu(1) or other outdial
          communications programs.  Unix and VMS flavors of Omen
          Technology's Professional-YAM communications software are
          available for dial-out applications.

          When using TrailBlazer or other buffered modems at high
          speed, particular attention must be paid to flow control.
          The modem and Unix must agree on the flow control method.
          Sz on USG (SYS III/V) systems uses XON/XOFF flow control.
          If flow control cannot be properly set up, Try a "-w2048"
          option to enforce protocol level flow control.  Experiment
          with different window sizes for best results.

          Telebit modems must not be set to "spoof" UUCP, XMODEM, or
          KERMIT.  Setting one of these spoofing modes interferes with
          other protocols.


          Circular buffering and a ZMODEM sliding window should be
          used when input is from pipes instead of acknowledging
          frames each 1024 bytes.  If no files can be opened, sz sends
          a ZMODEM command to echo a suitable complaint; perhaps it
          should check for the presence of at least one accessible
          file before getting hot and bothered.

          A few high speed modems have a firmware bug that drops
          characters when the direction of high speed transmission is
          reversed.  The environment variable ZNULLS may be used to
          specify the number of nulls to send before a ZDATA frame.
          Values of 101 for a 4.77 mHz PC and 124 for an AT are
          typical.

     BUGS
          On at least one BSD system, sz would abend it got within a
          few kilobytes of the end of file.  Using the "-w8192" flag
          fixed the problem.  The real cause is unknown, perhaps a bug
          in the kernel TTY output routines.

          The test mode leaves a zero length file on the receiving
          system.

     LICENSE
          Use of this software for commercial or administrative
          purposes except when exclusively limited to interfacing Omen
          Technology products requires a license from Omen Technology
          Inc.   Use of this code by inclusion, decompilation, reverse
          engineering or any other means constitutes agreement to
          these conditions and acceptance of liability to license the
          materials and payment of any reasonable legal or
          investigative costs necessary to enforce this license
          agreement.

          Copyright 1993 Omen Technology INC All Rights Reserved

          Omen Technology INC
          Post Office Box 4681
          Portland OR 97208
          503-621-3406


WebMaster@umkc.edu

Information Services, Central Computing
University of Missouri Kansas City