SZ.1 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. '\" Revision Level
  2. '\" Last Delta 5-19-86
  3. .TH SZ 1 OMEN
  4. .SH NAME
  5. sz \- XMODEM, YMODEM, ZMODEM Batch file Send
  6. .SH SYNOPSIS
  7. sz
  8. .RB [\- +1adfknqTuvy ]
  9. .I file ...
  10. .br
  11. sz -X
  12. .RB [\- 1kquv ]
  13. .I file
  14. .br
  15. sz
  16. .RB [\- 1qv ]
  17. .B "-c COMMAND"
  18. .br
  19. sz
  20. .RB [\- 1qv ]
  21. .B "-i COMMAND"
  22. .SH DESCRIPTION
  23. .B Sz
  24. uses the ZMODEM, YMODEM or XMODEM error correcting protocol to send
  25. one or more files over a serial port to a variety of programs running under
  26. PC-DOS, CP/M, Unix, VMS, and other operating systems.
  27. The first form of
  28. .B sz
  29. sends one or more files with ZMODEM or YMODEM batch protocol.
  30. Normally, only the file name part of the pathname is transmitted.
  31. On
  32. .SM Unix
  33. systems, additional information about the file is transmitted.
  34. If the receiving program uses this information,
  35. the transmitted file length controls the exact number of bytes written to
  36. the output dataset,
  37. and the modify time and file mode
  38. are set accordingly.
  39. Output from another program may be piped to
  40. .B sz
  41. for transmission by specifying the
  42. .B -1
  43. option and denoting standard input by "-":
  44. .ce
  45. ps -ef | sz -
  46. The program output is transmitted with the filename sPID.sz
  47. where PID is the process ID of the
  48. .B sz
  49. program.
  50. If the environment variable
  51. .B ONAME
  52. is set, that is used instead.
  53. In this case, the Unix command:
  54. .ce
  55. ONAME=con ps -ef|sz -ay -
  56. will send a "file" to the PC-DOS console display.
  57. The
  58. .B -y
  59. bypasses the receiver\'s checking of the output filename.
  60. The
  61. .B -a
  62. causes the receiver to convert Unix newlines to PC-DOS carriage returns
  63. and linefeeds.
  64. Unix
  65. .B sz
  66. supports
  67. .B YMODEM-g
  68. with "cbreak" tty mode, XON/XOFF flow control,
  69. and the interrupt character set to CAN.
  70. .B YMODEM-g
  71. (Professional-YAM
  72. .B g
  73. option)
  74. increases throughput over error free channels
  75. (direct connection, X.PC, etc.)
  76. by not acknowledging each transmitted sector.
  77. The second form of
  78. .B sz
  79. uses the
  80. .B -X
  81. flag to send a single
  82. .I file
  83. with
  84. .B XMODEM
  85. protocol.
  86. The user must supply the file name to both sending and receiving programs.
  87. Iff
  88. .B sz
  89. is invoked with $SHELL set and iff that variable contains the
  90. string
  91. .I "rsh"
  92. or
  93. .I "rksh"
  94. (restricted shell), sz operates in restricted mode.
  95. Restricted mode restricts pathnames to the current directory and
  96. PUBDIR (usually /usr/spool/uucppublic) and/or subdirectories
  97. thereof.
  98. The third form sends a single COMMAND to the receiver for execution.
  99. .B Sz
  100. exits with the COMMAND return value.
  101. If COMMAND includes spaces or characters special to the shell,
  102. it must be quoted.
  103. The fourth form sends a single COMMAND to the receiver for execution.
  104. .B Sz
  105. exits as soon as the receiver has received the command, before it is executed.
  106. If sz is invoked with stdout and stderr to different datasets,
  107. Verbose is set to 2, causing frame by frame progress reports
  108. to stderr.
  109. This may be disabled with the
  110. .B q
  111. option.
  112. .PP
  113. The meanings of the available options are:
  114. .PP
  115. .PD 0
  116. .TP
  117. .B +
  118. Force the receiver to append transmitted data to an existing file
  119. (ZMODEM only).
  120. .TP
  121. .B 1
  122. Use file descriptor 1 for ioctls and reads (Unix only).
  123. By default, file descriptor 0 is used.
  124. This option allows
  125. .B sz
  126. to be used with the
  127. .I cu
  128. ~$
  129. command.
  130. .TP
  131. .B a
  132. Convert NL characters in the transmitted file to CR/LF.
  133. This is done by the sender for XMODEM and YMODEM, by the receiver
  134. for ZMODEM.
  135. .TP
  136. .B "c COMMAND"
  137. Send COMMAND to the receiver for execution, return with COMMAND\'s exit status.
  138. .TP
  139. .B "C N"
  140. Make N attempts at ten second intervals
  141. to read COMMAND\'s exit status before exiting.
  142. .TP
  143. .B d
  144. Change all instances of "." to "/" in the transmitted pathname.
  145. Thus, C.omenB0000 (which is unacceptable to MSDOS or CP/M)
  146. is transmitted as C/omenB0000.
  147. If the resultant filename has more than 8 characters in the stem,
  148. a "." in inserted to allow a total of eleven.
  149. .TP
  150. .B f
  151. Send Full pathname.
  152. Normally directory prefixes are stripped from the transmitted
  153. filename.
  154. .TP
  155. .B "i COMMAND"
  156. Send COMMAND to the receiver for execution, return Immediately.
  157. .TP
  158. .B k
  159. Send files using YMODEM 1024 byte blocks
  160. rather than the default 128 byte blocks.
  161. 1024 byte packets speed file transfers at high bit rates.
  162. (ZMODEM streams the data for the best possible throughput.)
  163. .TP
  164. .B n
  165. Instruct ZMODEM receiver to skip files if the length and modification times
  166. of the source file and the file on the destination system are equal.
  167. .TP
  168. .B N
  169. Instruct ZMODEM receiver to skip files if the length and CRC\'s
  170. of the source file and the file on the destination system are equal.
  171. .TP
  172. .B q
  173. Quiet suppresses verbosity.
  174. .TP
  175. .B r
  176. Resume interrupted file transfer.
  177. If the source file is longer than the destination file,
  178. the transfer commences at the offset in the source file that equals
  179. the length of the destination file.
  180. .TP
  181. .B u
  182. Unlink the file after successful transmission.
  183. .TP
  184. .B v
  185. Verbose
  186. causes a list of file
  187. names to be appended to
  188. /tmp/szlog .
  189. More v's generate more output.
  190. .TP
  191. .B X
  192. Send a single file with
  193. .B XMODEM
  194. protocol.
  195. .TP
  196. .B y
  197. Force a ZMODEM receiving program to overwrite any existing file
  198. with the same name.
  199. .PD
  200. .SH EXAMPLES
  201. .ne 7
  202. .B "ZMODEM File Transfer"
  203. .br
  204. .B "$ sz -a *.c"
  205. .br
  206. This single command transfers all .c files in the current Unix directory
  207. with conversion
  208. .RB ( -a )
  209. to PC-DOS end of line conventions.
  210. With ZMODEM AutoDownload enabled, Professional-YAM automatically recieves
  211. the files after performing a security challenge.
  212. .B "ZMODEM Command Download"
  213. .br
  214. cpszall:all
  215. sz -c "c:;cd /yam/dist"
  216. sz -ya $(YD)/*.me
  217. sz -yqb y*.exe
  218. sz -c "cd /yam"
  219. sz -i "!insms"
  220. .br
  221. This Makefile fragment uses
  222. .B sz
  223. to issue commands to Professional-YAM to change current disk and directory.
  224. Next,
  225. .B sz
  226. transfers the
  227. .I .me
  228. files from the $YD directory, commanding the receiver to overwrite the old files
  229. and to convert from Unix end of line conventions to PC-DOS conventions.
  230. The third line transfers some
  231. .I .exe
  232. files.
  233. The fourth and fifth lines command Pro-YAM to
  234. change directory and execute a PC-DOS batch file
  235. .I insms .
  236. Since the batch file takes considerable time, the
  237. .B "-i"
  238. form is used to allow
  239. .B sz
  240. to exit immediately.
  241. .B "XMODEM File Transfer"
  242. .br
  243. $
  244. .B "sz -Xa foo.c"
  245. .br
  246. .B "ESC"
  247. .br
  248. .B "rx foo.c"
  249. .br
  250. The above three commands transfer a single file
  251. from Unix to a PC and Crosstalk XVI 3.6,
  252. translating Unix newlines to DOS CR/LF.
  253. .SH SEE ALSO
  254. rz(omen),
  255. ZMODEM.DOC,
  256. YMODEM.DOC,
  257. Professional-YAM manual,
  258. IMP(CP/M),
  259. cu(1),
  260. sq(omen),
  261. todos(omen),
  262. tocpm(omen),
  263. tomac(omen),
  264. yam(omen)
  265. Compile time options required for various operating systems are described in
  266. the source file.
  267. .SH "VMS VERSION"
  268. The VMS version does not transmit the file date.
  269. The VMS version calculates the file length by reading the file
  270. and counting the bytes.
  271. The VMS version does not support YMODEM-g or ZMODEM.
  272. When VMS is lightly loaded, the response time may be too quick for MODEM7
  273. unless the MODEM7
  274. .B "q"
  275. modifier is used.
  276. The VMS C standard i/o package and RMS sometimes interact to modify
  277. file contents unexpectedly.
  278. .SH FILES
  279. sz.c, rbsb.c, zm.c, zmodem.h source files
  280. /tmp/szlog stores debugging output (sz -vv)
  281. .SH "TESTING FEATURE"
  282. The command "sz -T file"
  283. exercises the
  284. .B Attn
  285. sequence error recovery by commanding
  286. errors with unterminated packets.
  287. The receiving program should complain five times about
  288. binary data packets being too long.
  289. Each time
  290. .B sz
  291. is interrupted,
  292. it should send a ZDATA header followed by another defective packet.
  293. If the receiver does not detect five long data packets,
  294. the
  295. .B Attn
  296. sequence is not interrupting the sender, and the
  297. .B Myattn
  298. string in
  299. .B sz.c
  300. must be modified.
  301. After 5 packets,
  302. .B sz
  303. stops the "transfer" and
  304. prints the total number of characters "sent" (Tcount).
  305. The difference between Tcount and 5120 represents the number of characters
  306. stored in various buffers when the Attn sequence is generated.
  307. .SH BUGS
  308. XMODEM transfers add up to 127 spurious bytes per file.
  309. Circular buffering and a ZMODEM sliding window should be used
  310. when input is from pipes instead of acknowledging frames each 1024 bytes.
  311. .B Sz
  312. should check for the presence of at least one accessible file before
  313. getting hot and bothered.
  314. The test mode leaves a zero length file on the receiving system.