Skip to main content

Using Zmodem with Anzio

Introduction

The various Anzio products support Zmodem file transfer, both over serial and TCP/IP. While Zmodem is a serial file transfer protocol, it does work equally well on hosts with well-behaved TCP/IP and telnet daemons. There are operating systems using not-behaved TCP/IP and telnet daemons in which Zmodem over TCP/IP struggles to work (primarily where the telnet daemon works in a character-per-character stream and can not handle large amounts of data all at once). Also, through the use of various options, some not-behaved systems may work more reliably.

This document covers the aspects of Anzio’s Zmodem file transfer where it will work, both serial and TCP/IP, and begins with references to Anzio version 11.3 or greater. This document is written to cover AnzioWin and Anzio Lite, though it applies equally to other Anzio products.

Host support for Zmodem, does my host support sz/rz?

Zmodem requires that both the PC and the host talk the same protocol while doing the file transfer. Hence there is a portion for the PC and a portion for the host. Anzio products contain the PC portion, the only question is does the machine you are attaching to support the host portion.

The host portion normally exists in the form of two programs, one for receiving a Zmodem transfer and one for initiating a Zmodem send. The receiving program is normally called "rz", while the sending portion is "sz". The quickest way to determine if you have sz and rz, is to log in to your host shell account and enter the following command at your host prompt:

sz

 

This should return with a list of available options for beginning a Zmodem send. If not, the chances are that you do not have access to the rz or sz programs (they may be located in a directory not found in your host path) or they have never been installed on your host. You will need to contact your system administrator. Sources and binaries for most hosts are readily available over the Internet and are not difficult to install.

Auto reception and initiating a file transfer

A file transfer using Zmodem is normally initiated by the sender. In order for this to take place, the receiving portion of the program must be readily available to start.

PC to Host

If you are doing a transfer from the PC to the host, somewhere in your hosts shell path, the program rz must be found. To test this, log in to your shell account and at the host prompt simply type rz. rz should return a message stating that it is waiting for you to begin your send (to abort this, do five Ctrl-X).

To initiate a file send from the PC to the host, enter the options (if any) followed by the file name in the Transfer:Zmodem:Send dialog box.

Host to PC

If  you are doing a transfer from the host to the PC, make sure that the Zmodem auto-reception item is checked. This is found under the Transfer:Zmodem submenu.

To initiate the file transfer from the host to the PC, at the host prompt, enter the sz command, followed by the options (if any) and the file name.

Aborting a transfer

Zmodem transfers can generally be aborted by the user by sending five (5) or more Ctrl-X ‘s, followed by several returns. The Ctrl-X is the interrupt character for the rz and sz program. The difficulty is this does not always abort the transfer immediately and depends upon where the program is in the transfer process. Be patient however as this could take a couple of minutes depending on how far behind the host is.

Within Anzio, using an Alt-A, a "grand abort", will abort the PC end. However, it is still quite often the case where the host end will continue receiving or sending and can cause additional problems (especially if a binary file is being sent by the host).

A second approach is to "kill" the process running (sz or rz) from a different telnet session or from another terminal. This "kill" will stop the transfer immediately.

A final, last resort, is to quit Anzio. By quitting Anzio, the connection is broken and the program running at the host end should cease immediately.

Zmodem send options

Anzio supports the following Zmodem options on send. These are entered in the Transfer:Zmodem:Send dialog box prior to the file name to transfer, i.e.

-bw 4000 binaryfile.exe

Option Description

First
Version

-a

Convert to local NL 
This option forces a file transfer to convert to the correct end-of-line characters for the host

11.3
-b Binary file transfer 
Force the file transfer to take place as a binary file, transferring the file to the host as is
11.3
-d Change dots to slashes 
Change all dots to slashes making directory separations
11.4
-f Send with full path 
Send the file with the full path name
11.4
-e Escape all Ctrl characters 
Encode all control characters that could pose a potential problem during file transfer
11.3
-n Send only if newer 
Send the file to the host only if the PC file’s creation date is newer
11.3
-N Send only if newer or longer 
Send the file to the host only if the PC file’s creation date is newer or the file size is larger
11.3
-p Protect an existing file 
If the file name already exists on the host, skip the file transfer
11.3
-q Send quiet, no display 
Send the file "quietly", no display of progress
11.4
-r Resume a previous send 
Restart a previously aborted send to host
11.4
-v Verbose debugging 
A log file will be created on the PC with debug information in it for the current send
11.4
-w Set window size 
Set the window size, the PC will wait for the host to catch up whenever the host gets this far behind
11.4
-Y Overwrite, skip of not present 
Overwrite the host file, but skip if the file does not exist already
11.3
-y Overwrite existing 
Overwrite the host file
11.3
-+ Append to existing  
Append the file to the existing host file, create the file if not found
11.3

 

Paths, wildcards and file names

Within the Anzio Zmodem send dialog, you can enter the full file name, including the PC path, for the file you want to transfer. If no path is entered, Anzio will attempt to locate the file to transfer in the current Transfer:Set Download Directory (Anzio v11.4) or in the current File:Logged Directory (prior to v11.4).

When Anzio Zmodem receives a file, the file is transferred into the Transfer:Set Download Directory (v11.3 or later) or into the File:Logged Directory (prior to v11.3).

With the 32-bit version of Anzio Lite or AnzioWin, long file names are permitted and handled correctly, including their case. In the case of 16-bit Anzio for DOS, AnzioNet, Anzio Lite and AnzioWin, the file names follow the standard DOS format of 8.3 (xxxxxxxx.xxx) and longer file names from the host will be truncated. Also in 16-bit Anzio, case is an issue and the file name going to the host, will be converted to upper case.

Whenever Anzio Zmodem send sees a wildcard character (*, ?), all files matching the string will be sent to the host, one at a time. Likewise, files sent from the host with a wildcard character, will be sent to the PC one at a time until all are completely transferred. If the host or PC filename being received already exists, Zmodem will not overwrite the file unless one of the overwrite options mentioned above are used. The file will be skipped and the next file processed. Within AnzioWin and Anzio Lite version 11.4 or later, when you access the Transfer:Zmodem:Send command, the common Windows file open dialog box is called, allowing you to search for the file to transfer. When you press OK, the Send dialog is brought up which will allow you to enter optional parameters at this point (remember that they need to be entered BEFORE the file name).

Also, it is possible in version 11.4 or later to override the host file name to receive. This is done by first turning off Transfer:Zmodem:Auto Reception, then starting the sz process at the host end. Next go to Transfer:Zmodem:Receive. This will call up the Windows common dialog for opening a new file to save to. Pressing OK will then begin the transfer.

Examples

Zmodem file transfer from the PC takes place in the Transfer:Zmodem:Send dialog. rz, or its equivalent, must be available in the host search path for the receive portion to do auto-reception. Options, if used, would come first and then the file name. Some examples of initiating an Anzio Zmodem transfer are below.

c:\temp\readme.txt this will send the file found in the \temp directory called readme.txt to the host
-Y readme.txt this sends the file readme.txt from the current directory to the host
-vpw 4500 test.exe this sends the file test.exe from the PC to the host, creating a log file and NOT overwriting the file if it exists, with a window of 4500 bytes (the send will pause when the PC gets 4500 bytes  ahead of the host until a good reply from the host is received)

Zmodem file transfer to the PC is done at the host shell prompt. sz must be available at the host end, and Transfer:Zmodem:Auto Reception must be checked for Anzio to automatically begin receiving a transmitted file. Some examples are:
 

% sz –b test.binary.exe this will transfer the binary file test.binary.exe to the PC
% sz –evNw 5000 binary.map this transfers the file binary.map, escaping control characters and creating a log file on the host, sending it only if its newer and with a window size of 5000 bytes
% sz –vvvv binary.map this adds even more detail to the hosts sz log file

The host log files are normally located under the /tmp directory as /tmp/szlog or /tmp/rzlog. If you do not have write permissions for this directory, the output usually comes to the screen and can be redirected to a local file, i.e.

sz –vvvvv binary.map > szlog

 

Also, a host-end receive log file can be created by starting rz prior to starting the transfer through Anzio. First do:

rz –vvvv

 

then go into Anzio’s Zmodem send and begin the transfer.

Troubleshooting

Zmodem on SCO UNIX, NCR UNIX and other restrictive network drivers

One thing to always remember, Zmodem file transfer is a serial protocol, it may not work with all network drivers. Several host systems out there use network drivers that do not behave well with streaming protocols over the telnet protocol. In these cases, we recommend looking into AnzioWin and FTP file transfer, or using a third-party FTP client with Anzio Lite (such as the FTP that ships with Windows).

SCO UNIX, NCR UNIX and others do not respond well to the Zmodem protocol with the generic Zmodem (sz/rz) applications available. If you run across a situation such as this, you may want to search the web for more information or contact your vendor.

Zmodem over general TCP/IP stacks

Zmodem file transfer does not work on all hosts, and does not work over all TCP/IP connections. A few hosts do not support large amounts of characters coming in over a telnet connection, and these hosts will "bog" down and have problems. For these type of hosts, we recommend investigating the use of FTP. Windowing with the –w option may help in some cases. This slows down the file transfer process and allows the host to catch up. The windowing takes place after the host transfer gets number of characters behind. Finding this optimum number is the key. The number can be determined by experimentation, starting with a recommended size of 4000 bytes and going up or down accordingly. The issue here is how fast can the telnet daemon and the host-end Zmodem protocol handle characters to and from the communications buffers, without falling so fare behind it can recover.

Troubleshooting A Send To Host

One of the available options for Zmodem under Anzio is the –v command for Verbose logging. When this option is included, a log file is created in the current transfer directory or in the home directory called anzzm.log. This contains information on the transfer and what occurred during each sent packet.

Also, a host-end receive log file can be created by starting rz prior to starting the transfer through Anzio. First do:

rz –vvvv

 

then go into Anzio’s Zmodem send and begin the transfer.

Troubleshooting Send To PC

Like Anzio, sz on the host can create a sender’s log file. To do this, you would enter

sz –vvv

 

The amount of information in the /tmp/szlog log file is determined by the number of "v"’s you include (usually 1 or 2 is sufficient, 4 or 5 will give you more than is really needed). From the receive end in Anzio, we have not implemented this option. However, each receive currently does create a basic log file.

Anzio’s Dialog Box Comes Up But The Transfer Does Not Start

On a send, a couple of potential problems could be occurring. The first, probable, would be that rz is not found. The program rz must exist somewhere in your shells search path (refer to your host path command).

Another potential send problem is that the file being sent may be present and your options are set to "protect" the file. Also if you do not have write permissions for the particular directory on the host, the file will not transfer.

On the receive side, if the dialog comes up, but the file transfer never begins, it is likely that some communications problem may be happening and the file transfer is "hung". Abort the send and check to see that all is ok. If you are transferring over TCP/IP, the problem could be the host and PC cannot synchronize with each other. In this case, abort and restart with a smaller window size.

Zmodem Fails With File Skipped Message Or A Failed Message

When Zmodem skips a file, the common reason is that the file already exists. Either remove the file in question and restart, or retry with one of the overwrite options.

Another potential problem is that you have no read or write permissions for the file in question, either on the PC or host end.

Zmodem Counts Keep Restarting

Occasionally Zmodem will send repositions when things get out of sync. This causes the file to restart at a previously good spot and continue forward.

If the PC seems to be getting way ahead, and repositions are causing the file to restart quite a ways back and quite often, this may indicate a communications problem or "lag". You may have better success using the windowing feature of Zmodem.

Anzio Is Displaying And Printing Garbage After Aborted Transfer

Occasionally aborted transfers do not complete immediately. It is possible that after an abort at the PC end, additional incoming data does need to get processed. While we try to catch all of this data and flush it out, there is potential for one or more buffers (TCP/IP or serial buffer, host-end buffers or Anzio’s buffers) to still contain data. That data may contain escape sequences that could cause Anzio to go into passthrough printing. In this case, do a couple of Alt-A, grand aborts, and the printing should stop.

Likewise, some of this data may make it to the screen. Clearing the screen ("clear" under most UNIX) should reset the screen for you.

Zmodem Failed - So How Do I Abort The Other End?

When Zmodem aborts within Anzio, such as when you do an Alt-A for a Grand Abort, it can leave the host in a state whereby the host is waiting for data to be received or where it is waiting for a command from Anzio. While Anzio will send the proper sequence to the host to abort, this some times can get lost in the transition. The general abort used by most host-based ZModem programs is a sequence of up to 5 Ctrl-X's followed by a couple returns (Enter). 

Likewise, the host can abort and leave Anzio hanging waiting for data or a command. To abort Anzio, use the Grand Abort, initiated with an Alt-A.

In either of the above cases, if the process does not work immediately, be patient. Even these abort methods may take time to time-out if there is some kind of connection hangup or for the program to exit its current wait state.

Copyright © 2020 Rasmussen Software, Inc. Legal Information & Privacy Policy
Send comments and suggestions to rsi@anzio.com