
			     Amiga zmodem
			     ------------



 Zmodem is a file transfer protocol which will enable you to transmit files
between different computers. In fact the zmodem programs can transfer files
using several popular protocols: Xmodem,Ymodem and Zmodem. To find out about
all the features of the zmodem programs, be sure to read rz.doc and sz.doc,
because I will only mention the features specific to the amiga version here.
 Please note that some features of UNIX zmodem are not supported. This is
mentioned in the zmodem '.doc' files.

 The reason I ported these programs to the Amiga, is that Zmodem file transfers
are very fast. When I was using Kermit the throughput I got was about 30
characters/second (1200 baud modem, going through packet switching network), now
with Amiga zmodem I get at least 100 characters/second. Your mileage may
vary, but I'm pretty sure you'll get a significant speedup if you've been
using either Kermit or Xmodem. Enjoy!

		    CONTENTS

	     I	 Installing zmodem
	     II  Quick explanation on transferring files
	     III Cooperating communications programs
	     IV  Amiga specific features
	     V	 Caveats,bugs and "features" (sigh!)


 I/ Installing zmodem

 To install UNIX zmodem rename the file 'makefile.unix' as 'makefile'. Then
type 'make system'. Where system is the version of UNIX you are using, and is
one of the following:

	sysv	    for SYSTEM 5 Unix
	xenix	    for SYSTEM 3/5 Xenix
	x386	    for 386 Xenix
	bsd	    for Berkeley 4.x BSD and Ultrix

 To install Amiga zmodem just uudecode the files rz.uu and sz.uu, and you're
ready to go.



 II/ Quick explanation on transferring files

 Sending files from UNIX to the AMIGA using zmodem:

			    (log in on UNIX machine)
			    (make sure preferences has the correct serial
			     setup, or that you have the zmodem.init file
			     correctly set up, or a cooperating
			     comm. program running)

    sz file1 file2 ...	    (type this on your UNIX system)
			    (exit your communications program)
    rz			    (type this on the Amiga)

 Sending files from the Amiga to UNIX using zmodem:

			    (log in on UNIX machine)
			    (if your comm. program doesn't cooperate
			     exit it.)
			    (make sure preferences has the correct serial
			     setup, or that you have the zmodem.init file
			     correctly set up, or a cooperating
			     comm. program running)
    sz file1 file2 ...	    (type this on the Amiga, Amiga sz automatically
			     fires up UNIX rz)



 III/ Cooperating communications programs

 There are many different protocols for transferring files from one
computer to another. So many in fact, that almost no terminal program
can support them all! So my idea was to provide a stand along program
that would work with a terminal program. This would allow more efficient
use of the computer's memory because the file transfer program would only
be in memory when it was actually being used. Also authors of terminal
programs could concentrate their efforts on other issues. The unique
features of the Amiga make this idea possible.

 Zmodem can cooperate with other programs using the serial port. For this
to work, the other program has to do two things:

    - Open the serial port in shared mode
    - suspend it's read operations while zmodem is transferring files

 Actually it's also a good idea to suspend write operations also, because
accidental keyboard input could interfere with the file transfer.

 An example of a cooperating communications program should be the new
version of VT100 (r. 2.9).

 If your comm. program doesn't cooperate, you can still be use Amiga zmodem.
Just exit your non-cooperating comm. program before running zmodem. If your
modem drops the line when you exit (ie. when DTR goes down), just use the
built in terminal mode in zmodem ('-T' switch).




 IV/ Amiga specific features

  a/Initializing the serial port

 A new amiga specific switch '-I' has been added to allow initialization of
the serial port parameters. If this switch is used, zmodem will look
for a file called 'zmodem.init', which can either be in the current
directory, or the 'S:' directory.

 The file has the following format: 1 line composed of

--------------------
baudrate nps
--------------------

 Where 'baudrate' is a number between 110 and 29,200 representing the
transmission speed to be used.

 Where 'n' is the number of bits per character (7 or 8).

 Where 'p' is the parity to be used. The value of 'p' will be
one of: 'N','E','O' (standing for None,Even and Odd respectively)

 And where 's' is the number of stop bits (between 0 and 2).

 So if you want your file transfers to take place at 2400 bits per second,
8 bits per character, no parity and 1 stop bit, you would place the following
line in your zmodem.init file:

2400 8N1

 These parameters have to be on the first line of the file, no other lines
will be examined. Also, if the zmodem.init file is not found, then the '-I'
switch will be ignored.

 If no '-I' is given on the command line, then default parameters are
used. This means that if a cooperating program using the serial port is in
use, then the default parameters are the ones set up by that program.
Otherwise the default parameters are the ones you have specified using
preferences. If you use preferences to specify the serial parameters you must
disenable xON/xOFF handshaking for Xmodem and Ymodem transfers to work
correctly.

 If the terminal program you are using doesn't cooperate, then zmodem will
tell you that it can't open the serial port for transferring files, and
abort its execution. In that case stop the terminal program before
running zmodem.

 When a cooperating terminal program is running, it isn't possible to
use the '-I' option. The parameters used will be automatically those
set up by the terminal program. If you try the '-I' option under these
conditions zmodem will print an error message and abort.

  b/ Aborting file transfers

 Zmodem can be aborted at any time by clicking in the close box of the zmodem
window.

  c/ Files to large for space remaining on disk

 Amiga zmodem will detect if the incoming file is too large to fit on the
current disk. The files that won't fit are skipped. Zmodem only checks the
space remaining at the start of each file, so you may still get full
disks, if you use up some of the remaining free space while the file
transfer is going on (hurrah for multi-tasking:-). This feature can be
disabled with the '-n' option, which is useful if the destination device
happens to be RAM:. That's because RAM:, is always full, so you couldn't
receive any files on it at all.

  d/ Ymodem file transfers

 With the UNIX version of zmodem, Ymodem transfers were requested by calling
zmodem using the names sb or rb (send batch or receive batch). But on
the amiga this isn't practical, since this would require keeping several
copies of zmodem, with only the name being different. To remedy this
situation, the '-B' switch was added, this lets you use the Ymodem protocol
and have only one copy of zmodem around.

examples: sz -B f1 f2 f3
	  rz -B

 e/ Xmodem file transfers

 To send with the xmodem protocol use: 'sz -X file', and for receiving
'rz file'. If you give a file name to rz, the file transfer will
be done using Xmodem protocol, even if on the sending end you specified
a zmodem transfer, so watch out!


 f/ Maintaining file protection bits

 When transferring between UNIX and the Amiga, the file protection
bits are also transfered. When sending from the amiga to UNIX the bits 'rwe'
are translated into the 'rwe' for user bits on UNIX. UNIX doesn't have a
'd' bit, but if you don't have write permission rm will ask for permission
to over-ride protection (ie. you can't delete it accidentally). So the UNIX
 'w' bit is translated into the Amiga 'wd' bits. That is to say if the UNIX
file doesn't have write permission the Amiga file won't have write or delete
permission. The transmission of the file protection bits can be overriden,
with the '-m' option. In this case the transmitted files will have the
default file protection bits.


 g/ Automatic ASCII transfer mode

 To be able to transfer raw binary files zmodem needs 8 bits per
character. If the serial port parameters aren't set up this way zmodem
automatically uses it's ASCII transfer mode. The transfer mode being used
by zmodem is printed when the file transfer starts. You should transfer
files using binary mode for files you want transferred without any changes
made to them. The ASCII mode will try to adapt the incoming file to
amiga text file conventions ( all CR LF sequences replaced by LF ).

 h/ Maintaining file dates

 One of the features of Zmodem, is that it keeps the same file-modification
date on the source and destination files. But due to the format used to
transmit the date, zmodem has to know what time zone you are in, relative
to the GM (Greenwich Meridian). I know this is strange, but that's the
way zmodem works. This time zone difference can also change during the year,
because GMT doesn't have any daylight savings time! Anyway, if you want
the file dates maintained you must add an extra number (this is an option)
into your zmodem.init file which specifies the difference between your local
time zone and GMT.

 In this case the format of the zmodem.init file becomes:

---------------------
baudrate nps gmt_diff
---------------------

my zmodem.init file is

  1200 8N1 +2  (this is for europe)

If you are in the EST time zone, you will probably set gmt_diff to -4.
If you don't care about the file-modification date on the transfered file,
the easiest thing to do is just leave gmt_diff out. Then the transfered
file's date will be set by zmodem to the current date.


 i/ Terminal mode

 A very primitive terminal mode has been provided, to enable those with "smart"
modems (ie. ones that drop phone connection when DTR goes down) to use zmodem.
Use the terminal mode to log in, and then click on the close box of the zmodem
window, the file transfer requested will follow automatically. Once the file
transfer is completed, zmodem will re-enter the terminal mode, permitting
you to log out cleanly.



 V/ Caveats,bugs and "features" (sigh!)

 If Ymodem protocol is used by the sending program, and the receiving
program is using Xmodem, the first file will be transferred, but the
sending Ymodem program will not exit correctly.

example: sz foo        <-- starts out with Zmodem, steps down to Ymodem
	 rz foo        <-- uses Xmodem because file name is given

 the correct sequences would be:

  sz foo bar toto	<-- Zmodem transfer
  rz

 or
  sz -B foo bar toto	<-- Batch Ymodem transfer
  rz -B
or
  sz -X foo	   <-- Xmodem transfer
  rz foo


 When using the '-f' option of sz (send whole pathname) the directories in
the path will not be created. If one of the directories in the pathname
doesn't exist, the file will not be sent. A newer version of UNIX rz will
handle the creation of the directories. Amiga rz still doesn't though.

 If you are using parity, amiga zmodem won't accept any characters without
the parity bit correctly set. Many UNIX hosts won't set the parity bit
correctly on output even if they are set up to check parity on input.
I recommend  avoiding using parity with zmodem whenever possible.
It limits you to transferring just text files anyway.

 Sz's -n (send file iff newer) and -N (send file if newer or longer) options
are not implemented in Unix or Amiga zmodem.

 Sz's -r (resume interupted file transfer) option isn't implemented in this
version of UNIX zmodem, or Amiga zmodem.

 Sz's -y (overwrite existing files with same name) option is pretty useles
with the UNIX and Amiga versions of zmodem, because this is already the
default behavior.

 I haven't been able to test Amiga zmodem at speeds other than 1200 bps.
I hope that zmodem will be reasonably efficient and bug free using
different speeds. If rz can't keep up at higher speeds, it may be
necessary to increase the size of the serial buffer using preferences.
If you increase the buffer size, don't use the '-I' option. With the
'-I' option the buffer size is always the same no matter what you choose
in preferences (1024 bytes).

---------------------------------------------------------------------------

 Many thanks to Chuck Forsberg who wrote the UNIX version of zmodem, and on
which Amiga zmodem is based. Thanks also go to all the good people who
have helped to make the amiga the useful and successful machine it is
today. The people from Los Gatos, and CATS. And also those who have
provided the public domain tools that have made this program possible,
Matt Dillon for DME and the shell, Steve Drew for his work on the shell,
Dave Wecker and Tony Sumrall for the vt100 terminal program, Peter Da Silva
for Browser, and all the other PD authors who's programs I've used. And of
course Fred Fish, for making all the PD software available.

 Please send bug reports and/or bug corrections to me:


  Frank Anthes-Harper
  72, Le Puech des Bruyeres
  Av. de Mr. Teste
  34070 Montpellier
  France

Usenet:  ...!ucbvax!decvax!uunet!mcvax!inria!geocub!anthes
