home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM A / PD-ROM A.iso / Telecom / Compacting Programs / Zmodem Sources / sz.1 < prev    next >
Encoding:
Text File  |  1989-03-14  |  11.0 KB  |  443 lines  |  [TEXT/MACA]

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