OS/2 File Transfer Protocol driver 1.5 (c) 1992 by Mikael Wahlgren =========================================================================== This is an external file transfer protocol driver, designed to supply other programs with file transfer capabilities. It is specially designed with Os2You (OS/2 Remote Access Facility by Mikael Wahlgren) and the Maximus/2 BBS program in mind. This protocol driver supports the following file transfer protocols: Xmodem/ChSum Xmodem/CRC Xmodem-1K Ymodem (batch) Ymodem-G (batch) Zmodem Kermit (*) (*) The Kermit file transfer protocol is supported in combination with the CKermit file transfer program (tested with CK5A188 release). CKOKER16.EXE must be available in the PATH. To install this program you copy all *.EXE and *.MSG in a directory specified by your PATH and DPATH statements. You copy the ZIP.DLL file into a directory specified by your LIBPATH statement. Possible return codes (ERRORLEVELs) =================================== ERR_NO_ERROR = 0 ERR_OPEN_FILE = 1 ERR_INIT_SESS = 2 ERR_DISK_READ = 3 ERR_DISK_WRITE = 4 ERR_COM_READ = 5 ERR_COM_WRITE = 6 ERR_CANCEL = 7 ERR_FATAL_COM = 8 ERR_NO_DCD = 9 ERR_LOCAL_CANCEL = 10 ERR_TIMEOUT = 255; (these error codes are only valid for Xmodem and Ymodem family protocols. For return codes of Zmodem and Kermit, see the M2Zmodem and CKermit documentations) Special instructions to run the program with Os2You =================================================== This program is especially designed with Os2You in mind. The recommended protocol is Ymodem, which is default. To use this protocol driver with Os2You, just copy the files into a pathed directory and run the following commands: Os2FTP -sC:\Files\*.DAT (to transfer files C:\Files\*.DAT) Os2FTP -rC:\Download (to receive files into C:\Download directory) If you want to use another protocol, like YmodemG, the commands will look like: Os2FTP -YMODEMG -sC:\Files\*.DAT Os2FTP -YMODEMG -rC:\Download Instructions on use with BBS ============================ Copy all of the distributed files into your Maximus home directory. To interface these protocols with the BBS (Maximus/2) you will have to add the following lines to your PROTOCOL.CTL file: ------------------------------- cut here ----------------------- Protocol Ymodem Type Batch LogFile Ymodem%K.Log ControlFile Ymodem%K.Ctl DownloadCmd OS2FTP.Exe -nosts -s#Ymodem%K.Ctl UploadCmd OS2FTP.Exe -nosts -r#Ymodem%K.Ctl DownloadString Send %s UploadString Get %s DownloadKeyword Sent UploadKeyword Got FilenameWord 1 DescriptWord 0 End Protocol Protocol G-Ymodem Type Batch LogFile YmodG%K.Log ControlFile YmodG%K.Ctl DownloadCmd OS2FTP.Exe -ymodemg -nosts -s#YmodG%K.Ctl UploadCmd OS2FTP.Exe -ymodemg -nosts -r#YmodG%K.Ctl DownloadString Send %s UploadString Get %s DownloadKeyword Sent UploadKeyword Got FilenameWord 1 DescriptWord 0 End Protocol Protocol M2-Zmodem Type Batch LogFile M2Z%K.Log ControlFile M2Z%K.Ctl DownloadCmd OS2FTP.Exe -zmodem -s#M2Z%K.Ctl UploadCmd OS2FTP.Exe -zmodem -r#M2Z%K.Ctl DownloadString Send %s UploadString Get %s DownloadKeyword Z-Sent: UploadKeyword Z-Received: FilenameWord 1 DescriptWord 0 End Protocol Protocol Kermit Type Batch LogFile KERM%K.Log ControlFile KERM%K.Ctl DownloadCmd OS2FTP.Exe -kermit -tmp\KERM%K -s#KERM%K.Ctl UploadCmd OS2FTP.Exe -kermit -tmp\KERM%K -r#KERM%K.Ctl DownloadString Send %s UploadString Get %s DownloadKeyword Sent UploadKeyword Got FilenameWord 1 DescriptWord 0 End Protocol ------------------------------- cut here ----------------------- You should also ensure that the PROTOCOL.CTL file is included in your MAX.CTL file (i.e. ensure that the MAX.CTL file is ended with a line like "include PROTOCOL.CTL") The Xmodem protocols should be possible to use in this way as well, but I can't see the use of this. There is no guarantee that these file transfer protocols work in all situations. Especially the Zmodem protocol is untested for this kind of usage. I am not legally responsible for any harm that your system may suffer from, by the use of this program. NOTE that if you use the Kermit protocol, the CKOKER16.EXE file MUST be available in the PATH (it is _NOT_ sufficient that it is in the current directory!). This version of OS2FTP is built to work together with CKermit version 5A188 released 25 January 1993. The CKermit package includes two different Kermit implementations CKOKER16.EXE for 16 or 32- bit OS/2 and CKOKER32.EXE for 32-bit OS/2. HOWEVER there seems to be a serious bug in CKOKER32.EXE (the 32-bit version) which prevents it from working for this kind of use. OS2FTP is built to first look for CKOKER32.EXE and if that can't be loaded try with CKOKER16.EXE. Thus I recommend you to REMOVE CKOKER32.EXE and ensure that ONLY CKOKER16.EXE is available. This as long as the bug in the 32-bit implementation remains unfixed. Also note that becuase the Kermit protocol is implemented using an external program, there are some limitations with regard to this. These limitations are (when using Kermit protocols): * All files are transfered to/from a temporary directory created by OS2FTP. This directory will normally be maintained automaticly by OS2FTP. This means that if a user request a file transfer batch of 3.5 Mbytes to/from the system, this will require 3.5 Mb of temporary disk space. * If a user cancels a Kermit download, the BBS will still treat this as a completed download (when adding to the download counters and so on). * The Kermit protocol can not be aborted by pressing Ctrl-X several times, as stated by Maximus before a file transfer begins. Programming information ======================= If you want to use OS2FTP with your own application you can easily interface to OS2FTP. To send files with XModem, Ymodem, Ymodem-G, Zmodem or Kermit from your application, you create a text file (let's call it OUT.TXT) like this: Send C:\MyPath\MyFile.TXT Send C:\MyPath\Package.ZIP Send C:\Another\Demo.TXT To start the file transfer you invoke OS2FTP with the following command: For Xmodem: OS2FTP -xmodem -nosts -s#OUT.TXT For Ymodem: OS2FTP -nosts -s#OUT.TXT For Ymodem: OS2FTP -ymodemg -nosts -s#OUT.TXT For Zmodem: OS2FTP -zmodem -s#OUT.TXT For Kermit: OS2FTP -kermit -tmp\TMPDIR -s#OUT.TXT To receive files with Xmodem, Ymodem, Ymodem-G, Zmodem or Kermit to your application (into the directory C:\InPath you create a text file (let's call it IN.TXT) like this: Get C:\InPath To start the receive you invoke OS2FTP with the following command: For Xmodem: OS2FTP -xmodem -nosts -r#IN.TXT For Ymodem: OS2FTP -nosts -r#IN.TXT For Xmodem: OS2FTP -ymodemg -nosts -r#IN.TXT For Zmodem: OS2FTP -zmodem -r#IN.TXT For Xmodem: OS2FTP -kermit -tmp\TMPDIR -r#IN.TXT After a successful transfer a log file will be created called OUT.LOG (if the filename OUT.TXT was used) or IN.LOG (if the filename IN.TXT was used). If the file transfer operation was done with Xmodem, Ymodem or Kermit each row in the log file should be scanned for the following keywords (there is no guarantee that the keyword will be placed first on the row): Sent yyy\xxx (yyy\xxx is the complete path to file received) Got yyy\xxx ( d:o ) If the file transfer was performed using Zmodem, the keywords are: Z-Sent: yyy\xxx (yyy\xxx is the complete path to file received) Z-Received: yyy\xxx ( d:o ) The log file should be erased before using OS2FTP again. Release log =========== 1.3 Modified for BBS usage 1.4 Ymodem-G transfers can now be cancelled correctly with Ctrl-X. Ymodem-G didn't detect carrier loss, this is fixed. Kermit protocol added. 1.5 Kermit handling modified to work with CKermit 5A188 from 25 January 1993. Licensing information ===================== If you haven't registered the Os2You/M2Zmodem/OS2FTP file transfer option, this program will introduce an intentional delay before transfering any files. Note that the Ymodem protocol used in this protocol driver is exactly the same driver that is built in Os2You, available via the Service functions menu. To register, use the included order form and specify the Os2You/M2Zmodem/OS2FTP item. Mikael Wahlgren