home *** CD-ROM | disk | FTP | other *** search
/ Share Gallery 1 / share_gal_1.zip / share_gal_1 / CO / CO004.ZIP / SZ.ZIP / ZMODEM.TXT < prev    next >
Text File  |  1987-10-23  |  17KB  |  541 lines

  1. RZ
  2.  
  3. NAME
  4.  
  5. rx, rb, rz - XMODEM, YMODEM, ZMODEM (Batch) file receive
  6.  
  7. SYNOPSIS
  8. rz [- " +1abepqtuv" ]
  9.  
  10. rb [- " +1abqtuv" ]
  11.  
  12. rz [- " 1abceqtuv" ] file
  13.  
  14. gz "file ..." [ - ][ v ] rzCOMMAND
  15.  
  16. DESCRIPTION
  17.  
  18. This program uses error correcting protocol to receive files over a
  19. serial port from a variety of programs running under PC-DOS, CP/M, Unix,
  20. and other operating systems. 
  21.  
  22. The first form of rz (Receive ZMODEM) receives files with the ZMODEM
  23. batch protocol.  If the sending program does not support ZMODEM, rz
  24. steps down to YMODEM protocol after 50 seconds.  This delay can be
  25. eliminated by invoking the program as rb. 
  26.  
  27. When receiving with XMODEM or YMODEM, Rz accepts either standard 128
  28. byte sectors or 1024 byte sectors.  The user should determine when the
  29. longer block length actually improves throughput without causing
  30. problems. 
  31.  
  32. If extended file information (file length, etc.) is received, the file
  33. length controls the number of bytes written to the output dataset
  34. (YMODEM only), and the modify time and file mode (iff non zero) are set
  35. accordingly. 
  36.  
  37. If no extended file information is received, slashes in the pathname are
  38. changed to underscore, and any trailing period in the pathname is
  39. eliminated.  This conversion is useful for files received from CP/M
  40. systems.  With YMODEM, each file name is converted to lower case unless
  41. it contains one or more lower case letters. 
  42.  
  43. The second form of rz receives a single file with XMODEM protocol.  The
  44. user must supply the file name to both sending and receiving programs. 
  45.  
  46. Gz is a shell script which calls sz to command Pro-YAM or ZCOMM to
  47. transmit the specified files.  Pathnames used with gz must be escaped if
  48. they have special significance to the Unix shell. 
  49.  
  50. EXAMPLE:
  51. gz "-a C:*.c D:*.h"
  52.  
  53. The third form of rz is invoked as rzCOMMAND (with an optional leading
  54. - as generated by login(1)).  For each received file, rz will pipe the
  55. file to ``COMMAND filename'' where filename is the name of the
  56. transmitted file with the file contents as standard input. 
  57.  
  58. Each file transfer is acknowledged when COMMAND exits with 0 status.  A
  59. non zero exit status terminates transfers. 
  60.  
  61. A typical use for this form is rzrmail which calls rmail(1) to post mail
  62. to the user specified by the transmitted file name.  For example,
  63. sending the file "caf" from a PC-DOS system to rzrmail on a Unix system
  64. would result in the contents of the DOS file "caf" being mailed to user
  65. "caf". 
  66.  
  67. On some Unix systems, the login directory must contain a link to COMMAND
  68. as login sets SHELL=rsh which disallows absolute pathnames.  If invoked
  69. with a leading ``v'', rz will report progress to /tmp/rzlog.  The
  70. following entry works for Unix 3.0:
  71.  
  72. rzrmail::5:1::/bin:/usr/local/rzrmail
  73.  
  74. If the SHELL environment variable includes "rsh" or "rksh" (restricted
  75. shell), rz will not accept absolute pathnames or references to a parent
  76. directory, will not modify an existing file, and removes any files
  77. received in error. 
  78.  
  79. If rz is invoked with stdout and stderr to different datasets, Verbose
  80. is set to 2, causing frame by frame progress reports to stderr.  This
  81. may be disabled with the q option. 
  82.  
  83. The meanings of the available options are:
  84.  
  85. 1
  86.  
  87. Use file descriptor 1 for ioctls and reads (Unix only).  By default,
  88. file descriptor 0 is used for ioctls and reads.  This option allows rz
  89. to be used with the Professional-YAM $ command and some versions of
  90. ncu(1). 
  91.  
  92. a
  93.  
  94. Convert files to Unix conventions by stripping carriage returns and all
  95. characters beginning with the first Control Z (CP/M end of file). 
  96.  
  97. b
  98.  
  99. Binary (tell it like it is) File transfer override. 
  100.  
  101. c
  102.  
  103. Request 16 bit CRC.  XMODEM file transfers default to 8 bit checksum. 
  104. YMODEM and ZMODEM normally use 16 bit CRC. 
  105.  
  106. D
  107.  
  108. Output file data to /dev/null for testing.
  109.  
  110. e
  111.  
  112. Force sender to escape all control characters; normally XON, XOFF, DLE,
  113. CR-@-CR, and Ctrl-X are escaped. 
  114.  
  115. p (ZMODEM)
  116.  
  117. Protect: skip file if destination file exists.
  118.  
  119. q
  120.  
  121. Quiet suppresses verbosity.
  122.  
  123. "t tim"
  124.  
  125. Change timeout to tim tenths of seconds. 
  126.  
  127. v
  128.  
  129. Verbose causes a list of file names to be appended to /tmp/rzlog .  More
  130. v's generate more output. 
  131.  
  132. 6
  133.  
  134. EXAMPLES
  135.  
  136. (Pro-YAM command)
  137.  
  138. <ALT-2>
  139.  
  140. Pro-YAM Command:
  141. "sz *.h *.c"
  142.  
  143. (This automatically invokes rz on the connected system.)
  144.  
  145. SEE ALSO ZMODEM.DOC, YMODEM.DOC, IMP(CP/M), Professional-YAM, sz(omen),
  146. usq(omen), undos(omen)
  147.  
  148. Compile time options required for various operating systems are
  149. described in the source file. 
  150.  
  151. NOTES
  152.  
  153. The Unix "ulimit" parameter must be set high enough to permit large file
  154. transfers. 
  155.  
  156. The TTY input buffering on some systems may not allow long blocks or
  157. streaming input at high speed.  You should suspect this problem when you
  158. can't send data to the Unix system at high speeds using ZMODEM when
  159. YMODEM with 128 byte blocks works properly.  If the system's tty line
  160. handling is really broken, the serial port or the entire system may not
  161. survive the onslaught of long bursts of high speed data. 
  162.  
  163. The DSZ or Pro-YAM "zmodem l" numeric parameter may be set to a value
  164. between 64 and 1024 to limit the burst length ("zmodem pl128"). 
  165.  
  166. 32 bit CRC code courtesy Gary S. Brown.
  167.  
  168. BUGS
  169.  
  170. Calling rz from most versions of cu(1) doesn't work because cu's receive
  171. process fights rz for characters from the modem. 
  172.  
  173. Pathnames are restricted to 127 characters.  In XMODEM single file mode,
  174. the pathname given on the command line is still processed as described
  175. above.  The ASCII option's CR/LF to NL translation merely deletes
  176. CR's; undos(omen) performs a more intelligent translation. 
  177.  
  178. "VMS VERSION"
  179.  
  180. Some of the #includes with file names enclosed with angle brackets <>
  181. may need to have the angle brackets changed to "", or vice versa.
  182.  
  183. The VMS version does not set binary mode according to the incoming file
  184. type.  Non binary file processing consists of stripping all characters
  185. beginning with CPMEOF (^Z). 
  186.  
  187. The VMS version does not set the file time.
  188.  
  189. At high speeds, VMS sometimes loses incoming characters, resulting in
  190. retries and degradation of throughput. 
  191.  
  192. The mysterious VMS C Standard I/O Package and RMS may interact to modify
  193. file contents unexpectedly. 
  194.  
  195. The VMS version does not support invocation as rzCOMMAND .  ZMODEM has
  196. not yet been implemented on the VMS version. 
  197.  
  198. "ZMODEM CAPABILITIES"
  199.  
  200. Rz supports incoming ZMODEM binary (-b), ASCII (-a), protect (-p), and
  201. append (-+) requests, and ZMODEM command execution. 
  202.  
  203. FILES
  204.  
  205. rz.c, rbsb.c, zm.c, zmodem.h source files.
  206.  
  207.  
  208.  
  209. SZ
  210.  
  211. NAME
  212.  
  213. sx, sb, sz - XMODEM, YMODEM, ZMODEM file send
  214.  
  215. SYNOPSIS
  216.  
  217. sz [- +1abdefkLlNnopqTtuvyY ] file ...
  218.  
  219. sb [- 1adfkqtuv ] file ...
  220.  
  221. sx [- 1akqtuv ] file
  222.  
  223. sz [- 1oqtv ] "-c COMMAND"
  224.  
  225. sz [- 1oqtv ] "-i COMMAND"
  226.  
  227. DESCRIPTION
  228.  
  229. Sz uses the ZMODEM, YMODEM or XMODEM error correcting protocol to send
  230. one or more files over a serial port to a variety of programs running
  231. under PC-DOS, CP/M, Unix, VMS, and other operating systems. 
  232.  
  233. The first form of sz sends one or more files with ZMODEM protocol. 
  234.  
  235. ZMODEM greatly simplifies file transfers compared to XMODEM.  In
  236. addition to a friendly user interface, ZMODEM provides Personal Computer
  237. and other users an efficient, accurate, and robust file transfer method. 
  238.  
  239. ZMODEM provides complete "END-TO-END" data integrity between application
  240. programs.  ZMODEM's 32 bit CRC catches errors that sneak into even the
  241. most advanced networks. 
  242.  
  243. Advanced file management features include AutoDownload (Automatic file
  244. Download initiated without user intervention), Crash Recovery, selective
  245. file transfers, and preservation of exact file date and length. 
  246.  
  247. Output from another program may be piped to sz for transmission by
  248. denoting standard input with "-":
  249.  
  250. ps -ef | sz -
  251.  
  252. The program output is transmitted with the filename sPID.sz where PID is
  253. the process ID of the sz program.  If the environment variable ONAME is
  254. set, that is used instead.  In this case, the Unix command:
  255.  
  256. ONAME=con ps -ef|sz -ay -
  257.  
  258. will send a "file" to the PC-DOS console display.  The -y option
  259. instructs the receiver to open the file for writing unconditionally. 
  260. The -a option causes the receiver to convert Unix newlines to PC-DOS
  261. carriage returns and linefeeds. 
  262.  
  263. The second form is invoked as sb to batch send one or more files with
  264. ZMODEM or YMODEM protocol.  The initial ZMODEM initialization is not
  265. sent.  When requested by the receiver, sb supports YMODEM-g with
  266. "cbreak" tty mode, XON/XOFF flow control, and interrupt character set to
  267. CAN (^X).  YMODEM-g (Professional-YAM g option) increases throughput
  268. over error free channels (direct connection, X.PC, etc.) by not
  269. acknowledging each transmitted sector. 
  270.  
  271. On Unix systems, additional information about the file is transmitted. 
  272. If the receiving program uses this information, the transmitted file
  273. length controls the exact number of bytes written to the output dataset,
  274. and the modify time and file mode are set.
  275.  
  276. The third form of sz is invoked as sx to send a single file with XMODEM
  277. or XMODEM-1k protocol (sometimes incorrectly called "ymodem").  The user
  278. must supply the file name to both sending and receiving programs. 
  279.  
  280. Iff sz is invoked with $SHELL set and iff that variable contains the
  281. string "rsh" or "rksh" (restricted shell), sz operates in restricted
  282. mode.  Restricted mode restricts pathnames to the current directory and
  283. PUBDIR (usually /usr/spool/uucppublic) and/or subdirectories thereof. 
  284.  
  285. The fourth form sends a single COMMAND to a ZMODEM receiver for
  286. execution.  Sz exits with the COMMAND return value.  If COMMAND includes
  287. spaces or characters special to the shell, it must be quoted. 
  288.  
  289.  
  290. The fifth form sends a single COMMAND to a ZMODEM receiver for
  291. execution.  Sz exits as soon as the receiver has correctly received the
  292. command, before it is executed. 
  293.  
  294. If sz is invoked with stdout and stderr to different datasets, Verbose
  295. is set to 2, causing frame by frame progress reports to stderr.  This
  296. may be disabled with the q option. 
  297.  
  298.  
  299. The meanings of the available options are:
  300.  
  301. 0
  302.  
  303. Instruct the receiver to append transmitted data to an existing file
  304. (ZMODEM only). 
  305.  
  306. 1
  307.  
  308. Use file descriptor 1 for ioctls and reads.  By default, file descriptor
  309. 0 is used.  This option allows sz to be used with the Professional-YAM $
  310. command. 
  311.  
  312. a
  313.  
  314. Convert NL characters in the transmitted file to CR/LF.  This is done by
  315. the sender for XMODEM and YMODEM, by the receiver for ZMODEM. 
  316.  
  317. b (ZMODEM)
  318.  
  319. Binary override: transfer file without any translation. 
  320.  
  321. "c COMMAND"
  322.  
  323. Send COMMAND to the receiver for execution, return with COMMAND's exit
  324. status. 
  325.  
  326. d
  327.  
  328. Change all instances of "." to "/" in the transmitted pathname.  Thus,
  329. C.omenB0000 (which is unacceptable to MSDOS or CP/M) is transmitted as
  330. C/omenB0000.  If the resultant filename has more than 8 characters in
  331. the stem, a "." is inserted to allow a total of eleven. 
  332.  
  333. e
  334.  
  335. Escape all control characters; normally XON, XOFF, DLE, CR-@-CR, and
  336. Ctrl-X are escaped. 
  337.  
  338. f
  339.  
  340. Send Full pathname.  Normally directory prefixes are stripped from the
  341. transmitted filename. 
  342.  
  343. "i COMMAND"
  344.  
  345. Send COMMAND to the receiver for execution, return Immediately upon the
  346. receiving program's successful recption of the command. 
  347.  
  348. k
  349.  
  350. (XMODEM/YMODEM) Send files using 1024 byte blocks rather than the
  351. default 128 byte blocks.  1024 byte packets speed file transfers at high
  352. bit rates.  (ZMODEM streams the data for the best possible throughput.)
  353.  
  354. "L N"
  355.  
  356. Use ZMODEM sub-packets of length N.  A larger N (32 <= N <= 1024) gives
  357. slightly higher throughput, a smaller N speeds error recovery.  The
  358. default is 128 below 300 baud, 256 above 300 baud, or 1024 above 2400
  359. baud.
  360.  
  361. "l N"
  362.  
  363. Wait for the receiver to acknowledge correct data every N (32 <= N <=
  364. 1024) characters.  This may be used to avoid network overrun when XOFF
  365. flow control is lacking. 
  366.  
  367. n (ZMODEM)
  368.  
  369. Send each
  370. file if destination file does not exist.  Overwrite destination file if
  371. source file is newer than the destination file.
  372.  
  373. N (ZMODEM)
  374.  
  375. Send each file if destination file does not exist.  Overwrite
  376. destination file if source file is newer or longer than the destination
  377. file.
  378.  
  379. o (ZMODEM)
  380.  
  381. Disable automatic selection of 32 bit CRC. 
  382.  
  383. p (ZMODEM)
  384.  
  385. Protect existing destination files by skipping transfer if the
  386. destination file exists.
  387.  
  388. q
  389.  
  390. Quiet suppresses verbosity.
  391.  
  392. r (ZMODEM)
  393.  
  394. Resume interrupted file transfer.  If the source file is longer than the
  395. destination file, the transfer commences at the offset in the source
  396. file that equals the length of the destination file. 
  397.  
  398. "t tim"
  399.  
  400. Change timeout to tim tenths of seconds.
  401.  
  402. u
  403.  
  404. Unlink the file after successful transmission. 
  405.  
  406. v
  407.  
  408. Verbose causes a list of file names to be appended to /tmp/szlog .  More
  409. v's generate more output. 
  410.  
  411. y
  412.  
  413. Instruct a ZMODEM receiving program to overwrite any existing file with
  414. the same name. 
  415.  
  416. Y
  417.  
  418. Instruct a ZMODEM receiving program to overwrite any existing file with
  419. the same name, and to skip any source files that do have a file with the
  420. same pathname on the destination system.
  421.  
  422. EXAMPLES
  423.  
  424. 7 "ZMODEM File Transfer"
  425.  
  426. "$ sz -a *.c"
  427.  
  428. This single command transfers all .c files in the current Unix directory
  429. with conversion ( -a ) to end of line conventions appropriate to the
  430. receiving environment.  With ZMODEM AutoDownload enabled,
  431. Professional-YAM and ZCOMM will automatically recieve the files after
  432. performing a security check. 
  433.  
  434.  
  435. "$ sz -Yan *.c *.h"
  436.  
  437. Send only the .c and .h files that exist on both systems, and are newer
  438. on the sending system than the corresponding version on the receiving
  439. system, converting Unix to DOS text format. 
  440.  
  441. "ZMODEM Command Download"
  442.  
  443.  cpszall:all
  444.     sz -c "c:;cd /yam/dist"
  445.     sz -ya $(YD)/*.me
  446.     sz -yqb y*.exe
  447.     sz -c "cd /yam"
  448.     sz -i "!insms"
  449.  
  450. This Makefile fragment uses sz to issue commands to Professional-YAM to
  451. change current disk and directory.  Next, sz transfers the files from
  452. the $YD directory, commanding the receiver to overwrite the old files
  453. and to convert from Unix end of line conventions to PC-DOS conventions. 
  454. The third line transfers some .exe files.  The fourth and fifth lines
  455. command Pro-YAM to change directory and execute a PC-DOS batch file
  456. insms .  Since the batch file takes considerable time, the "-i" form is
  457. used to allow sz to exit immediately. 
  458.  
  459. "XMODEM File Transfer"
  460. (To Crosstalk)
  461.  
  462. $
  463. "sx -a foo.c"
  464.  
  465. "ESC"
  466.  
  467. "rx foo.c"
  468.  
  469. The above three commands transfer a single file from Unix to a PC and
  470. Crosstalk with sz translating Unix newlines to DOS CR/LF.  This
  471. combination is much slower than ZMODEM.  SEE ALSO rz(omen), ZMODEM.DOC,
  472. YMODEM.DOC, Professional-YAM, IMP(CP/M), sq(omen), todos(omen),
  473. tocpm(omen), tomac(omen), yam(omen)
  474.  
  475. Compile time options required for various operating systems are
  476. described in the source file.  "VMS VERSION" The VMS version does not
  477. transmit the file date.  The VMS version calculates the file length by
  478. reading the file and counting the bytes. 
  479.  
  480. The VMS version does not support YMODEM-g or ZMODEM. 
  481.  
  482. When VMS is lightly loaded, the response time may be too quick for
  483. MODEM7 unless the MODEM7 "q" modifier is used. 
  484.  
  485. The VMS C standard i/o package and RMS sometimes interact to modify file
  486. contents unexpectedly.
  487.  
  488. FILES
  489.  
  490. 32 bit CRC code courtesy Gary S.  Brown. 
  491.  
  492. sz.c, rbsb.c, zm.c, zmodem.h source files
  493.  
  494. /tmp/szlog stores debugging output (sz -vv)
  495.  
  496. "TESTING FEATURE"
  497.  
  498. The command "sz -T file" exercises the Attn sequence error recovery by
  499. commanding errors with unterminated packets.  The receiving program
  500. should complain five times about binary data packets being too long. 
  501. Each time sz is interrupted, it should send a ZDATA header followed by
  502. another defective packet.  If the receiver does not detect five long
  503. data packets, the Attn sequence is not interrupting the sender, and the
  504. Myattn string in sz.c must be modified. 
  505.  
  506. After 5 packets, sz stops the "transfer" and prints the total number of
  507. characters "sent" (Tcount).  The difference between Tcount and 5120
  508. represents the number of characters stored in various buffers when the
  509. Attn sequence is generated.  BUGS Calling sz from most versions of cu(1)
  510. doesn't work because cu's receive process fights sz for characters from
  511. the modem. 
  512.  
  513. Many programs claiming to support YMODEM only support XMODEM with 1k
  514. blocks, and they often don't get that quite right. 
  515.  
  516. XMODEM transfers add up to 127 garbage bytes per file (1023 bytes with
  517. XMODEM-k). 
  518.  
  519. YMODEM programs use the file length transmitted at the beginning of the
  520. transfer to prune the file to the correct length; this may cause
  521. problems with source files that grow during the course of the transfer. 
  522. This problem does not pertain to ZMODEM transfers, which preserve the
  523. exact file length unconditionally. 
  524.  
  525. Most ZMODEM options are merely passed to the receiving program; some do
  526. not implement all these options. 
  527.  
  528. Circular buffering and a ZMODEM sliding window should be used when input
  529. is from pipes instead of acknowledging frames each 1024 bytes.  If no
  530. files can be opened, sz sends a ZMODEM command to echo a suitable
  531. complaint; perhaps it should check for the presence of at least one
  532. accessible file before getting hot and bothered.  The test mode leaves a
  533. zero length file on the receiving system. 
  534.  
  535. Some high speed modems have a firmware bug that drops characters when
  536. the direction of high speed transmissson is reversed.  The environment
  537. variable ZNULLS may be used to specify the number of nulls to send
  538. before a ZDATA frame.  Values of 101 for a 4.77 mHz PC and 124 for an AT
  539. are typical. 
  540.  
  541.