home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / bin / p205.zip / p.doc < prev    next >
Text File  |  1994-12-18  |  34KB  |  887 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                                  "P"
  7.  
  8.                     The transfer protocol package
  9.  
  10.                              version 2.05
  11.  
  12.                   Copyright (c) 1994 by Jyrki Salmi
  13.  
  14.                          All rights reserved.
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21. 1. Introduction
  22.  
  23.         This is a transfer protocol package providing Zmodem,
  24.         Ymodem-g, Ymodem and Xmodem protocols for Bulletin Board
  25.         Systems, Terminal programs and where ever reliable high speed
  26.         file transfer protocols are needed.
  27.  
  28.         Package consists of two parts:
  29.  
  30.           P.DLL - A dynamic link library that contains the transfer
  31.                   protocol routines.
  32.  
  33.           P.EXE - The front-end for P.DLL. A program that processes
  34.                   user options and then calls the DLL to do the actual
  35.                   transfer.
  36.         
  37.         During development the main goal has been achieving the maximum
  38.         performance possible under OS/2. Not much time has been spent
  39.         on creating a beautiful and 'friendly' user interface. If you
  40.         aren't happy with P.EXE, you can always make your own
  41.         front-end for the DLL.
  42.                 
  43.         The author takes no responsibility whatsoever for any damage
  44.         caused by P. If you decide to use this package or parts of it,
  45.         you do it at your own risk!
  46.  
  47.  
  48. 2. Credits
  49.  
  50.         Chuck Forsberg for creating Zmodem and documenting it.
  51.         Public domain sources of rzsz were used as a reference during
  52.         the development of P.DLL.
  53.  
  54.         Ward Christensen for creating Xmodem and Ymodem.
  55.  
  56.         Gary S. Brown for the CRC calculation routines. These were
  57.         found from the public domain rzsz sources.
  58.  
  59.     Jeffrey Altman for making the CKOP200.INI file.
  60.  
  61.         Many people who reported about bugs in the previous versions
  62.         of P and gave me lots of new ideas.
  63.  
  64.  
  65. 3. Distribution policy
  66.  
  67.         P.EXE - the front-end for the DLL is distributed as public
  68.         domain, meaning that anyone can modify and recompile the
  69.         sources and do whatever they want with it. However, credits to
  70.         the original author (me) would be highly appreciated but not
  71.         required, if found so repugnant.
  72.  
  73.         P.DLL - the transfer protocol engine is distributed as
  74.         freeware, meaning that the author (me) wants to keep his
  75.         copyright to the program but gives everyone the right to use
  76.         and copy it freely, without of charge.
  77.         
  78.  
  79. 4. Supported protocols and their variations
  80.  
  81. 4.1 Xmodem
  82.  
  83.         This is one of the oldest transfer protocols ever. It was
  84.         developed by Ward Christensen in 1977. It proved to be an
  85.         excellent file transfer protocol because of its robustness and
  86.         reasonable performance.
  87.  
  88.         The basic Xmodem used 128 byte blocks and one byte Checksum
  89.         for error checking. There has been many extension to Xmodem
  90.         over the years. One is CRC-16 checking and one is the use of
  91.         1024 byte blocks. Both of these extensions are support by P
  92.         (-alternative option and -kilo option).
  93.  
  94. 4.2 Ymodem
  95.  
  96.         Ymodem is one of many extensions to Xmodem. It adds one block
  97.         in front of every transferred file, providing file name, size
  98.         and date information, you don't have to enter the file name at
  99.         both ends of transmission like with Xmodem. Ymodem
  100.         also made it possible to transfer many files with just one
  101.         command. Ymodem uses CRC-16 as its default error checking
  102.         method, however Checksum is still supported (-alternative
  103.         option). P uses 128 blocks with Ymodem as the default, you
  104.         might want to use 1024 byte blocks (-kilo option) to improve
  105.         the throughput.
  106.  
  107.         Xmodem and Ymodem were very efficient with low speed
  108.         connections, but due to introduction of new high speed and
  109.         buffered modems we found that it wasn't enough.
  110.  
  111. 4.3 Ymodem-g
  112.  
  113.         Ymodem-g is an extension to Ymodem protocol. All it adds is a
  114.         continuous data transfer. Transferred blocks don't wait for
  115.         acknowledge before transferring the next one. Ymodem-g made it
  116.         possible to take out virtually all of the throughput provided
  117.         by hardware. However, it had one downgrade: It didn't have any
  118.         kind of error recovery. CRC-16 checking was still done, but in
  119.         case of an error the transfer was simply aborted instead of
  120.         retransmission of the broken block.
  121.  
  122.         There were also many other problems with all of the Xmodem
  123.         derived implementations. They needed a totally transparent
  124.         data path, making it impossible to use them over connections
  125.         which used software flow control (XON/XOFF).
  126.  
  127.         The error recovery / speed tradeoff was also one of the main
  128.         reasons for the development of new de facto protocol: Zmodem.
  129.  
  130. 4.4 Zmodem
  131.  
  132.         Zmodem was developed by Chuck Forsberg at Omen Technology,
  133.         Inc. in 1986. It wasn't based on the old Xmodem engine and
  134.         that made it possible to implement many new features. The
  135.         major feature was its possibility to send data in continuous
  136.         stream and still recover from possible errors. Zmodem also
  137.         introduced escaping, making it possible to transfer binary
  138.         files over non-transparent connections.
  139.  
  140.         User convenience was also taken in consideration in
  141.         development of Zmodem. Transmission parameters needed to be
  142.         specified only at the one end. File name, size, and date
  143.         information is of course also transferred, just like in
  144.         Ymodem. Automatic start of receiving is also made possible by
  145.         sending a ZRQINIT sequence at the beginning of the transfer,
  146.         allowing terminal programs to monitor for it.
  147.  
  148.         Zmodem supports 32-bit CRC frame checking (frames are
  149.         equivalent to Xmodem and Ymodem blocks) which increases the
  150.         reliability remarkably.
  151.  
  152.         With Zmodem you don't have to transfer files right from the
  153.         beginning in case connection was lost for some reason. Zmodem
  154.         offers a crash recovery which you can use to continue the
  155.         transfer from right there where it got interrupted.
  156.  
  157.         Since the late 1980s Zmodem has remained as the de facto
  158.         transfer protocol and is still going strong.
  159.  
  160.  
  161. 5. Installation
  162.  
  163.         To transfer files you will need only P.EXE and P.DLL. The
  164.         DLL will be searched from the directories on your LIBPATH and
  165.         if not found there, it's looked up from the directory where
  166.         your P.EXE resides.
  167.  
  168. 5.1 C-Kermit
  169.  
  170.     Included in this package is file CKOP200.INI which is an
  171.     initialization file for C-Kermit. Copy it to your C-Kermit
  172.     directory and add the following line in your CKERMOD.INI file:
  173.  
  174.     take ckop200.ini
  175.  
  176.         Next time you'll start your C-Kermit you'll have following
  177.         commands added to it:
  178.  
  179.         rz - Receive with Zmodem
  180.         sz - Send with Zmodem
  181.         ry - Receive with Ymodem
  182.         sy - Send with Ymodem
  183.         rg - Receive with Ymodem-g
  184.         sg - Send with Ymodem-g
  185.         rx - Receive with Xmodem
  186.         sx - Send with Xmodem
  187.  
  188.         The connect type will be automatically detected and therefore
  189.         same commands work for asynchronous, named pipe and TCP/IP
  190.         stream socket connections.
  191.  
  192.     Check the CKOP200.INI file and change the paths and options if
  193.         necessary.
  194.  
  195. 5.2 LiveWire
  196.  
  197.         Included in this package is a file named LW_P.CMD. It is an
  198.         OS/2 command file that is meant to be called from LiveWire.
  199.  
  200.         First, copy that LW_P.CMD to your LiveWire directory and then
  201.         start LiveWire.
  202.  
  203.         Go to Protocol menu and choose first blank entry from the
  204.         list. Fill the fields with following information:
  205.  
  206. ╒════ External Protocol ═══════════════════════════════════════════════════╕
  207. │ Name                  Zmodem (P)░░░░░░░░░░                               │
  208. │ Hotkey                P                                                  │
  209. │ Prompt filename       Yes                                                │
  210. │ Auto-receive string   B00░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │
  211. │ Receive command 1     LW_P.CMD async receive Zmodem %0 %1 %2 %3░░░░░░░░░ │
  212. │ Receive command 2     ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │
  213. │ Send command 1        LW_P.CMD async send Zmodem %0 %1 %2 %3░░░░░░░░░░░░ │
  214. │ Send command 2        ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │
  215. ╘══════════════════════════════════════════════════════════════════════════╛
  216.  
  217.         Note that you'll get the arrow pointing upwards by pressing
  218.         CTRL-X.
  219.  
  220.         Now choose Zmodem-32 batch from the list and set the
  221.         Auto-download to Off. From now on P's Zmodem will
  222.         automatically start Zmodem receiving when needed.
  223.  
  224.         Other protocols are added just like but by replacing
  225.         occurrences of "Zmodem" with the name of corresponding
  226.         protocol: "Ymodem", "Ymodem-g" or "Xmodem". Also remember to
  227.         remove the Auto-receive string for other protocols.
  228.  
  229.         To use P with named pipe connection you have to have separate
  230.         protocol entries. Add protocols just like above but change the
  231.         "async" text to "pipe" in each protocol command.
  232.  
  233.         See also LW_P.CMD if you want to change the options passed to
  234.         P.EXE.
  235.  
  236.  
  237. 6. Command-line parameters of P.EXE
  238.  
  239.         When you run P.EXE without any parameters you will get an usage
  240.         that lists all of the available options. Here they are once again,
  241.     with detailed descriptions:
  242.  
  243. 6.1 -type {async | pipe | socket}
  244.  
  245.         Select the type of communications to be used.
  246.  
  247.         async  = OS/2 Asynchronous device (RS-232C)
  248.         pipe   = OS/2 Named pipe (Local or network)
  249.         socket = TCP/IP stream socket
  250.  
  251.         If not specified, async will be assumed.
  252.  
  253. 6.2 -device <name | path>
  254.  
  255.         Specify the name of asynchronous device (e.g. COM1), or path
  256.         to the named pipe (e.g. \PIPE\P).
  257.  
  258.         Affects only to async and pipe communications.
  259.  
  260. 6.3 -host <address>
  261.  
  262.         Internet address of host to connect to. This can be a
  263.         resolvable name or plain IP number.
  264.  
  265.         Affects only to socket communications.
  266.  
  267. 6.4 -port <port>
  268.  
  269.         Number of stream socket port to use. Choose this number to be
  270.         big enough to not collide with other ports. See your
  271.         TCPIP\ETC\PROTOCOLS file for reserved ports.
  272.  
  273.         Affects only to socket communications.
  274.  
  275. 6.5 -server
  276.  
  277.         Specifies that we act as a server for the file transfer. We'll
  278.         create a named pipe or stream socket and wait for a client to
  279.         connect to it. The wait time can specified with the -wait
  280.         option.
  281.  
  282.         Has an effect only when type of communications is pipe or socket,
  283.         and no already open handle is available.
  284.  
  285. 6.6 -wait <seconds>
  286.  
  287.         Specifies the number of seconds to wait for the client to connect to
  288.         us. While waiting a beep can be heard every second, to disable
  289.         the noise specify -quiet option.
  290.  
  291.         Has an effect only when acting as a server.
  292.  
  293. 6.7 -share
  294.  
  295.         Open the communication device in shared mode. Specify this
  296.         option if you can't pass a handle to P and you have to "steal"
  297.         the communication device from a suspended process. With this
  298.         option it is also possible to use P.EXE from a DOS program.
  299.  
  300.         Affects only to async and pipe communications, when no already open
  301.         handle is available.
  302.  
  303. 6.8 -handle <handle>
  304.  
  305.         Specifies a handle for an already open asynchronous device,
  306.         pipe or socket. If specified and connection is asynchronous or
  307.         pipe, the -device option should also be specified to make the
  308.         error messages report possible errors on the correct
  309.         device. If -device is not specified, error messages could be
  310.         something like this:
  311.  
  312.         Failed to control device: "(null)"
  313.  
  314.         But if for example "-device com1" option was specified the
  315.         error message would be:
  316.  
  317.         Failed to control device: "com1"
  318.  
  319.         That's all the -device option is used for when handle is
  320.         available, therefore it's not required for transfer to work.
  321.  
  322.         For stream socket connections -host and -port option are not
  323.         needed at all. Socket numbers are used with error messages
  324.         instead of device name.
  325.  
  326. 6.9 -loose
  327.  
  328.         If specified, the state of carrier signal will be ignored during the
  329.         the file transfer. You might need to specify this option if
  330.         your modem fails to maintain the state of carrier signal, or
  331.         if you're transferring files with a null-modem cable.
  332.  
  333.         Affects only to async communications.
  334.  
  335. 6.10 -telnet
  336.  
  337.         Escape telnet IAC characters and CR NUL sequences in the data stream
  338.         and process possible incoming telnet commands. Use this option
  339.         when you're transferring files through a telnet
  340.         session. However, this can be used with other types of
  341.         communication too.
  342.  
  343. 6.11 -receive
  344.  
  345.         Specifies that we are receiving files.
  346.  
  347. 6.12 -send
  348.  
  349.         Specifies that we are sending files.
  350.  
  351. 6.13 -protocol {xmodem | ymodem | ymodem-g | zmodem}
  352.  
  353.         Specifies the transfer protocol to be used. See section 4 in
  354.         this document for further information about the transfer
  355.         protocols.
  356.  
  357.         If not specified, Zmodem will be assumed.
  358.  
  359. 6.14 -escape {controls | minimal}
  360.  
  361.         Specify the escaping to be done during the file transfer.
  362.  
  363.         By default P escapes following characters in the data flow
  364.         when transferring with Zmodem:
  365.  
  366.         ASCII 16        (Ctrl-P)
  367.         ASCII 144       (Ctrl-P with 8th bit set)
  368.         ASCII 17   (*)  (XON)
  369.         ASCII 145  (*)  (XON with 8th bit set)
  370.         ASCII 19   (*)  (XOFF)
  371.         ASCII 147  (*)  (XOFF with 8th bit set)
  372.         ASCII 24   (*)  (Ctrl-X)
  373.         ASCII 152       (Ctrl-X with 8th bit set)
  374.  
  375.         And these if they follow an ASCII 64 ('@') or
  376.         ASCII 192 ('@' with 8th bit set):
  377.  
  378.         ASCII 13        (Carriage return)
  379.         ASCII 141       (Carriage return with 8th bit set)
  380.  
  381.         control - This makes us to escape all control characters
  382.                   (ASCII 0 to 31). Escaping generates overhead by
  383.                   transmitting two bytes to represent every control
  384.                   character. Use it only if your connection can't pass
  385.                   them through. 
  386.  
  387.         minimal - This makes us to escape as few characters as
  388.                   possible so that the protocol still works with
  389.                   standard implementations (marked with asterisks in
  390.                   the list above).
  391.  
  392.         Affects only to Zmodem transfers.
  393.  
  394. 6.15 -alternative
  395.  
  396.         Specifies that an alternative error checking method should be used.
  397.  
  398.         Here is the list of supported protocols with their default and
  399.         alternative checking methods:
  400.  
  401.         Protocol        Default         Alternative
  402.         --------        -------         -----------
  403.         Zmodem          CRC-32          CRC-16
  404.         Ymodem-g        CRC-16          N/A
  405.         Ymodem          CRC-16          Checksum
  406.         Xmodem          Checksum        CRC-16
  407.  
  408.         See the following sections for detailed information about the
  409.         checking methods.
  410.  
  411.         This option has no meaning when sending files with Ymodem-g,
  412.         Ymodem or Xmodem, it is up to the receiver to choose the error
  413.         checking method to be used.
  414.  
  415. 6.15.1 CRC-32
  416.  
  417.         32-bit CRC is the most effective error checking method
  418.         supported by P. It's based on a 32-bit number (4 bytes)
  419.         calculated with a polynomial specified by ANSI X3.66
  420.         specification.
  421.  
  422.         This 32-bit number is calculated by the sender and
  423.         transferred with every 1024 (or less) bytes. The receiver does
  424.         the same calculation on received data and if the results
  425.         are different the data is requested to be sent again. The
  426.         probability of garbled data getting through is practically
  427.         nil.
  428.  
  429. 6.15.2 CRC-16
  430.  
  431.         This is based on a 16-bit number (2 bytes) calculated with a
  432.         similar polynomial to one used with 32-bit CRC. The
  433.         probability of garbled data getting through is much higher
  434.         than with CRC-32, but it's still very very small.
  435.  
  436. 6.15.3 Checksum
  437.  
  438.         This an ancient checking method used by the first versions of
  439.         Xmodem. It's based on a 8-bit (1 byte) number calculated from
  440.         transferred data by summing up all bytes in it.
  441.  
  442.         For example, Checksum of three bytes: 'a' (ASCII decimal 97),
  443.         'b' (ASCII decimal 98) and 'c' (ASCII decimal 99) is '&'
  444.         (ASCII decimal 38). It comes from 97 + 98 + 99 = 294 saved in
  445.         8-bit number, which cuts it to 38.
  446.  
  447.         With Checksum checking the probability of garbled data getting
  448.         acknowledged is relatively high, so whenever possible you
  449.         should use CRC-16 instead. 
  450.  
  451. 6.16 -kilo
  452.  
  453.         If specified, 1024 byte blocks will be used instead of default
  454.         128 byte. This speeds up the transfer considerably on high
  455.         speed connections. However, the probability of garbled data
  456.         getting through grows when there is more data to calculate the
  457.         check value from, thus you should avoid using 1024 byte blocks
  458.         with Checksum checking.
  459.  
  460.         Affects only to Ymodem-g, Ymodem and Xmodem sending, when
  461.         receiving it's up to the sender to define the block size.
  462.  
  463. 6.17 -window <bytes>
  464.  
  465.         Specifies the size of transfer window to be used. Valid range is
  466.         from 256 to 65472, and the size must be a multiple of 64.
  467.  
  468.         By specifying a window size you make P to wait for acknowledge
  469.         from the remote for every <bytes> transferred, when the
  470.         default is sending data in full streaming, without any
  471.         acknowledges.
  472.  
  473.         Using this option might be necessary if you're sending data through a
  474.         network where some nodes might timeout if data isn't
  475.         transferred to one direction for a certain time.
  476.  
  477.         Using a small window size slows down the transfer somewhat.
  478.  
  479.         Affects only to Zmodem transfers.
  480.  
  481. 6.18 -automatic
  482.  
  483.         Specifies that we should send a string "rz" followed by a carriage
  484.         return to the remote before starting the transfer. If there's
  485.         an UNIX shell running at the other end it will be interpreted
  486.         as the user has just typed "rz" and then pressed enter, and
  487.         the UNIX rz program will be run.
  488.  
  489.         If you're not transferring files to an UNIX system this option
  490.         just generates more garbage to remote screen at the
  491.         initialization phase, in case it hasn't started the receiving
  492.         program yet.
  493.  
  494.         Affects only to Zmodem sending.
  495.  
  496. 6.19 -serial
  497.  
  498.         If specified, the serial number of the remote will we queried and
  499.         displayed. This option is meant for informational purposes
  500.         only.
  501.  
  502.         Affects only to Zmodem sending.
  503.  
  504. 6.20 -attention <string>
  505.  
  506.         Specifies an attention string that will be sent when receiving
  507.         files with Zmodem and you would like to get the attention of the
  508.         sender. 
  509.  
  510.         Following characters have a special meaning in the attention string:
  511.  
  512.         ASCII 221 -- Break signal
  513.         ASCII 222 -- One second pause
  514.  
  515. 6.21 -commbufs <bytes>
  516.  
  517.         Specifies the size of both, input and output communication buffer.
  518.         Default is 2048 bytes.
  519.  
  520.         Specifying a bigger buffer has an effect only to protocols
  521.         sending and receiving data in continuous streams: Zmodem and
  522.         Ymodem-g.
  523.  
  524.         With a bigger buffer and a reliable connection you can speed up
  525.         the throughput considerably. But if the connection requires
  526.         retransmits, a big buffer can slow down the throughput much
  527.         more and generate a lot of annoying garbage to the remote
  528.         screen if the transfer gets cancelled.
  529.  
  530.         For example if you specify 32768 bytes long buffers, we will
  531.         block in read or write routines until all data is read or
  532.         written. If you're sending with Zmodem and there is an error
  533.         in transmission, it won't be recovered until all data in the
  534.         buffers is transferred. And if you're using Ymodem-g the
  535.         transfer will be aborted in case of an error, all data in
  536.         buffers will be written to the remote screen until we
  537.         recognize the abortion.
  538.  
  539.         And when receiving with Zmodem or Ymodem-g, we won't check for
  540.         possible transmission errors until whole buffer is received,
  541.         making it possible for us to transfer a lot of data that's to
  542.         be resent.
  543.  
  544.         There's no maximum limit for the buffer sizes. The bigger you
  545.         specify the more memory will be eaten. Under multitasking
  546.         environments like OS/2, with bigger buffers a bit less
  547.         processor time will be consumed during the transfer.
  548.  
  549. 6.22 -comminbuf <bytes>
  550.  
  551.         Specifies explicitly the size of communication input
  552.         buffer. See -commbufs option for further information.
  553.  
  554. 6.23 -commoutbuf <bytes>
  555.  
  556.         Specifies explicitly the size of communication output
  557.         buffer. See -commbufs option for further information.
  558.  
  559. 6.24 -filebuf <bytes>
  560.  
  561.         Specifies the size of file read and write buffer. If not specified,
  562.         no internal file buffering will be done.
  563.  
  564.         By specifying a bigger file buffer it is possible to speed up
  565.         considerably file transfers to or from slow media, like
  566.         CD-ROMs or floppy drives.
  567.  
  568.         It's also possible to send contents of a floppy without needing
  569.         to keep it in the drive all the time. Just specify big enough
  570.         buffer for files to be sent and all data will be read into
  571.         memory in the beginning of the transfer and send from there.
  572.  
  573.         Transfers using an asynchronous device (cps < 10000) are not
  574.         likely to benefit from a bigger file buffer, but if the
  575.         communication device is either named pipe or stream socket,
  576.         bigger buffer is most likely to improve the throughput.
  577.  
  578.         There's no maximum limit for the size of file buffer, you
  579.         could even transfer contents of a whole hard drive if you
  580.         wanted to (and had enough memory for the buffer).
  581.  
  582.         The optimal buffer size is best found by experimenting. You
  583.         could start for example by specifying a 32k byte buffer and
  584.         compare the CPSs to what you get without a buffer at all.
  585.  
  586. 6.25 -speed <bps>
  587.  
  588.         Specifies the throughput speed in bits per second. This
  589.         value will be used only to calculate the transfer time
  590.         estimates. If not specified or <bps> is 0, time estimates
  591.         will not be shown.
  592.  
  593. 6.26 -mileage
  594.  
  595.         If specified, the number of files and bytes left to transfer
  596.         (and estimated time) is displayed before each file.
  597.  
  598.         Affects only to batch transfers and works only when receiving
  599.         and the sender provides such information.
  600.  
  601. 6.27 -options
  602.  
  603.         If specified, the conversion, management and transport options
  604.         received from the sender will be shown on the screen in a
  605.         verbal form. This option is meant mainly to aid problem
  606.         determination.
  607.  
  608.         Affects only to Zmodem receiving.
  609.  
  610. 6.28 -headers
  611.  
  612.         Specifies that received Zmodem headers and their contents
  613.         should be shown on the screen in a verbal form during the
  614.         transfer. This option is meant mainly to aid problem
  615.         determination.
  616.  
  617.         Affects only to Zmodem transfers.
  618.  
  619. 6.29 -frameends
  620.  
  621.         Specifies that received Zmodem frame ends should be shown on
  622.         the screen in verbal form during the transfer. This option is
  623.         meant mainly to aid problem determination. 
  624.  
  625.         Affects only to Zmodem transfers.
  626.  
  627. 6.30 -note <text>
  628.  
  629.     With this option you can specify a text that will be displayed
  630.     on the top line of screen during the transfer. This is
  631.     especially useful for BBS operators who want to see the name
  632.     of the user transferring files. The line is written by using
  633.     ANSI screen control codes.
  634.  
  635. 6.31 -quiet
  636.  
  637.         Do not beep after the file transfer and when acting as a communication
  638.         server and waiting for a client to connect to us.
  639.  
  640. 6.32 -priority <class> <delta>
  641.  
  642.         Specifies the priority of file transfer process.
  643.  
  644.         Valid values for priority class are:
  645.  
  646.         0 - No class change
  647.         1 - Idle-time
  648.         2 - Regular
  649.         3 - Time-critical
  650.         4 - Server
  651.  
  652.         Priority delta can be any value in range of -31 to 31.
  653.  
  654.         You might want to specify a higher priority for the file
  655.         transfer process if you are running simultaneously something
  656.         that is consuming lot of CPU time, like playing DOS games, etc.
  657.  
  658.         Lower priority might come into consideration if you're
  659.         transferring files on the background and don't want the
  660.         foreground process to get effected by the transfer.
  661.  
  662. 6.33 -dszlog <path>
  663.  
  664.         If specified, a DSZ compatible log about files transferred
  665.         will be created in the file pointed by the <path>. This option
  666.         is essential for most of the Bulletin Board Systems.
  667.  
  668. 6.34 -pause
  669.  
  670.         Wait for a key press after the transfer, before exiting. This
  671.         option might became useful if you're using P.EXE as an
  672.         external protocol provider for some software that clears the
  673.         screen after we exit. By clearing the screen it prevents the
  674.         user from reading the messages displayed by P.EXE at the end
  675.         of the transfer.
  676.  
  677. 6.35 -directory <directory>
  678.  
  679.         Specifies the directory where received files are to be saved.
  680.         If not specified, files will be saved to the current
  681.         directory. Directory path can be trailed by a backslash or not.
  682.  
  683. 6.36 -paths
  684.  
  685.         Do not strip drive and directory components from the file
  686.         paths sent and received.
  687.  
  688.         Be careful with this option if you're receiving files, it
  689.         would be possible for the other end to send files to any drive
  690.         and directory on your system.
  691.  
  692.         Has no meaning to Xmodem transfers.
  693.  
  694. 6.37 -create
  695.  
  696.         If specified, non-existing directory structures will be
  697.         created.
  698.  
  699.         Has meaning only when receiving files and -paths option is
  700.         specified.
  701.  
  702. 6.38 -clean
  703.  
  704.         Delete files from failed transfers. If specified, transfers cannot
  705.         be resumed later on. This option is useful for keeping your
  706.         disks clean from garbage files.
  707.  
  708. 6.39 -touch
  709.  
  710.         If specified, the date information received with files will be
  711.         ignored. The date of received files will correspond to the
  712.         time of transfer.
  713.  
  714. 6.40 -recursive
  715.  
  716.         If specified, files specified on the command-line are searched
  717.         recursively, making it possible to send contents of whole
  718.         directory structure.
  719.  
  720.         Affects only to Zmodem, Ymodem-g and Ymodem sending.
  721.  
  722. 6.41 -text
  723.  
  724.         If specified, a text conversion will be done on received and sent
  725.         files. Meaning that CR LF line end sequences will be
  726.         translated to the convention used by the remote system and
  727.         vice versa.
  728.  
  729.         Note that this option should be used only when transferring
  730.         text files.
  731.  
  732.         With Zmodem, this option is passed also to the remote at the
  733.         initialization phase.
  734.  
  735. 6.42 -resume
  736.  
  737.         Specifies that we should try to resume aborted file transfers
  738.         i.e. when file already exists and its size is smaller than the
  739.         size of the new file.
  740.  
  741.         With Zmodem, this option is passed also to the remote at the
  742.         initialization phase.
  743.  
  744.         Affects only to Zmodem transfers.
  745.  
  746. 6.43 -existing
  747.  
  748.         If specified, no new files will be created. Only the already
  749.         existing files will be updated or re-transferred.
  750.  
  751.         With Zmodem, this option is passed also to the remote at the
  752.         initialization phase.
  753.  
  754. 6.44 -update
  755.  
  756.         If specified, already existing files will be replaced only if the
  757.         new file is longer or newer.
  758.  
  759.         With Zmodem, this option is passed also to the remote at the
  760.         initialization phase.
  761.  
  762. 6.45 -append
  763.  
  764.         If specified, already existing files will get the new data appended
  765.         to them.
  766.  
  767.         With Zmodem, this option is passed also to the remote at the
  768.         initialization phase.
  769.  
  770. 6.46 -replace
  771.  
  772.         If specified, already existing files will be replaced by the new
  773.         ones.
  774.  
  775.         With Zmodem, this option is passed also to the remote at the
  776.         initialization phase.
  777.  
  778. 6.47 -newer
  779.  
  780.         If specified, already existing files will be replaced only if the
  781.         new one has a later date.
  782.  
  783.         With Zmodem, this option is passed also to the remote at the
  784.         initialization phase.
  785.  
  786. 6.48 -different
  787.  
  788.         If specified, already existing files will be replaced only if
  789.         dates or lengths are different.
  790.  
  791.         With Zmodem, this option is passed also to the remote at the
  792.         initialization phase.
  793.  
  794. 6.49 -protect
  795.  
  796.         If specified, already existing files won't be replaced at any
  797.         situation.
  798.  
  799.         With Zmodem, this option is passed also to the remote at the
  800.         initialization phase.
  801.  
  802. 6.50 -rename
  803.  
  804.         If specified, files will be renamed if one with an identical name
  805.         already exists.
  806.  
  807.         With Zmodem, this option is passed also to the remote at the
  808.         initialization phase.
  809.  
  810. 6.51 [<file> | <@listfile> ...]
  811.  
  812.         The rest of the command-line is for paths to files to be sent
  813.         or received. If you have a lot of files to transfer you might
  814.         want to use a listfile instead of specifying them all on the
  815.         command-line. Listfiles are plain ASCII files containing file
  816.         paths on separate lines.
  817.  
  818.         Listfiles are distinguished from the normal file paths on the
  819.         command-line by the preceding '@' character. You can mix up
  820.         any number of paths and listfiles on the command-line.
  821.  
  822.         Either backslash ('\') or slash ('/') characters can be used
  823.         as a directory and name separator.
  824.  
  825.         If the name of first file to be transferred begins with a
  826.         character '-', it should be preceded by a plain '-' separated
  827.         by space from the last option and this file name.
  828.  
  829.         When sending files, the use of these file paths is obvious,
  830.         those files are to be sent. If the file specified can't be
  831.         opened, either it doesn't exist or it's being used by some
  832.         another application, it will be skipped.
  833.  
  834.         You can specify any number of files to be transferred with
  835.         protocols that support batch transmissions, that is all but
  836.         Xmodem. With Xmodem you can specify only one file, whether you
  837.         are receiving or sending.
  838.  
  839.         When receiving with a protocol supporting batch transfers you
  840.         don't have to specify any files at all. However, if you do,
  841.         only those files specified will be received. If you are
  842.         receiving with Zmodem, the files not found on the command-line
  843.         will be skipped. With Ymodem, the transfer will be aborted,
  844.         because the protocol does not support skipping.
  845.  
  846.  
  847. 7. Using P.DLL with your own applications
  848.  
  849.         The whole protocol engine itself resides in P.DLL. P.EXE only
  850.         acts as a front-end. Anyone can use the DLL with their
  851.         application to provide file transfer protocols. User interface
  852.         is not limited anyway, the calling program can be either PM
  853.         based or plain VIO text application.
  854.  
  855.         P.DLL can be linked to your application by using an import
  856.         library or by dynamically loading and freeing the library when
  857.         needed. For more information about import libraries see your C
  858.         compiler's manual or IMPLIB section of OS/2 Toolkit's Tools
  859.         Reference. No import library is included in this distribution,
  860.         you have to create one from the DLL with IMPLIB or similar
  861.         utility.
  862.  
  863.         P.DLL has only one entry function: p_transfer(). A pointer to a
  864.         configuration structure is passed as a parameter to the entry
  865.         function. The configuration structure contains transfer
  866.         parameters and pointers to callback functions which are used
  867.         to give information about the progress of the transfer back to
  868.         the calling application, and to handle files being
  869.         transferred. For detailed description of the configuration
  870.         structure and callback functions see P.H header file in the
  871.         "exesrc" directory.
  872.  
  873.         The best way to get hold of it is probably by studying the
  874.         sources of P.EXE, especially callback.c.
  875.  
  876.  
  877. 8. Afterword
  878.  
  879.         I hope you find some use for all this. If you have any problems,
  880.         questions or you just want to give a comment, drop me a note:
  881.  
  882.         Internet: jytasa@jyu.fi
  883.         FidoNet: Jyrki Salmi (2:225/12)
  884.  
  885.  
  886.                                 * * *
  887.