rxFtp Rexx Function Package for TCP/IP FTP for OS/2 2.0 by Patrick ...

existencetubΔίκτυα και Επικοινωνίες

26 Οκτ 2013 (πριν από 3 χρόνια και 8 μήνες)

80 εμφανίσεις




rxFtp



Rexx Function Package for TCP/IP FTP for OS/2 2.0



by Patrick Mueller



(c) Copyright International Business Machines Corporation 1993.


All rights Reserved.


----
------------------------------------------------------------------

what is rxFtp?

----------------------------------------------------------------------


rxFtp is a REXX function package providing access to the OS/2

TCP/IP FTP API as provided by the I
BM TCP/IP product, version

1.2.1.


The function package assumes you know how to use the FTP program.

The function names in the package closely resemble FTP subcommands.


This function package requires the OS/2 TCP/IP product, version 1.2.1

or higher
. A specific DLL for the OS/2 TCP/IP product, version 2.0, is

included.


----------------------------------------------------------------------

installation and removal

----------------------------------------------------------------------


The rxFt
p rexx function package is contained in the file rxFtp.dll.

This file needs to be placed in a directory along your LIBPATH. To get

access to the functions in the rxFtp function package, execute the

following rexx code:



rc = RxFuncAdd("FtpLoadFunc
s","rxFtp","FtpLoadFuncs")


rc = FtpLoadFuncs()


If you want to use the 32
-
bit FTP functions available in TCP/IP for OS/2

Version 2.0, rename the "rxftp32.dll" file to "rxftp.dll".


You may not use both the 16
-
bit and 32
-
bit versions at the same ti
me as

they have the same function names.


To unload the DLL, you should first call the FtpDropFuncs()

function, then exit all CMD.EXE shells. After exiting all the

command shells, the DLL will be dropped by OS/2 and can be deleted

or replaced.


--
--------------------------------------------------------------------

Parameters and Return Values

----------------------------------------------------------------------


----------------------------------------------------------------------

Return val
ues

----------------------------------------------------------------------



o Set errors



The following functions return Set error codes:



FtpSetUser


FtpSetBinary



The return code is 1 if the string passed in are valid, 0
if not.


FtpSetBinary() should be passed an abbreviation of "BINARY" or


"ASCII" (thus, "b", "as", "BIN", etc).




o FTP errors



The rest of the functions (all the functions but the Set functions)


return ftp error conditions.



It will have one of the following values (or a numeric value if the


number isn't one of these documented values):



"0"
-

successful call


"
-
1"
-

Error during FTP function call



If the function returns a "
-
1
" for a return code, the variable
FTPERRNO


will be set to one of the following values:



"FTPSERVICE"
-

unknown service


"FTPHOST"
-

unknown host


"FTPSOCKET"
-

unable to obtain socket


"FTPCONNECT"
-

unabl
e to connect to server


"FTPLOGIN"
-

login failed


"FTPABORT"
-

transfer aborted


"FTPLOCALFILE"
-

problem openning local file


"FTPDATACONN"
-

problem initializing data connection


"FTPCOMMAND"
-

command
failed


"FTPPROXYTHIRD"
-

proxy server does not support third party
transfers


"FTPNOPRIMARY"
-

no primary connection for proxy transfer


----------------------------------------------------------------------

Functions Reference

--------
--------------------------------------------------------------



-------------------------------------------------------------------


FtpLoadFuncs


-------------------------------------------------------------------



rc = FtpLoadFuncs(qui
et)



Loads all the functions in the rxFtp package.



If ANY parameters are passed to this function, it will bypass


the program/author/copyright information normally displayed.


All parameters are ignored (except to determine whe
ther or not


to bypass displaying the information).



-------------------------------------------------------------------


FtpDropFuncs


-------------------------------------------------------------------



rc = FtpDropFuncs()




Drops all the functions in the rxFtp package.



-------------------------------------------------------------------


FtpVersion


-------------------------------------------------------------------



rc = FtpVersion(variable)



Re
turns the version of RxFtp that you are running in the variable


"variable".



-------------------------------------------------------------------


Set Functions


-------------------------------------------------------------------


FtpSe
tUser(host,userid,password<,account>)


FtpSetBinary("Binary" | "Ascii")



FtpSetUser() sets the host, userid, and password for the


remote host that most of the other functions require.


FtpSetBinary() sets the default text translatio
n


for functions that can use this. This Binary or Ascii setting


can be overriden by any function that takes it as an option


parameter.



Note that the host, userid, password, and account are retained


during the life of t
he process. If you are using the RxFtp


package within a .CMD file run the OS/2 prompt, this means the


life of the CMD.EXE process. You may want to 'blank' out the


password (at least) when you are finished, to prevent unauthorized



access to a host you previously used.



-------------------------------------------------------------------


File Functions


-------------------------------------------------------------------


FtpAppend(localFile,remoteFile[,"Binary" | "A
scii"])


FtpDelete(remoteFile)


FtpGet(localFile,remoteFile[,"Binary" | "Ascii"])


FtpPut(localFile,remoteFile[,"Binary" | "Ascii"])


FtpPutUnique(localFile,remoteFile[,"Binary" | "Ascii"])


FtpRename(oldFile,newFile)



These function
s perform work on files. The function should


be obvious, except for FtpPutUnique() which insures the remote


file created is unique, and does not overwrite the name of a


file which already exists.



--------------------------------
-----------------------------------


Directory List Functions


-------------------------------------------------------------------


FtpLs(pattern,stem)


FtpDir(pattern,stem)



These functions return directory list information in the



stemmed variable passed in. FtpLs() returns 'short' form;


FtpDir() returns 'long' form. The Stem value should be


a string with a "." at the end. When the function completes,


the variable stem || ".0" will be set to the number of
stem


variables returned, which are set in variables stem || ".1",


stem || ".2", etc.



-------------------------------------------------------------------


Directory Functions


-------------------------------------------------------
------------


FtpPwd(variable)


FtpChDir(directory)


FtpMkDir(directory)


FtpRmDir(directory)



These functions work with directories. The function should be


obvious. FtpPwd() returns the name of the current directory on


the remote host if no error occurred in the variable "variable"



-------------------------------------------------------------------


Logoff Function


-------------------------------------------------------------------


FtpLogoff()



T
his function should be called to terminate all ftp sessions.



-------------------------------------------------------------------


Miscellaneous Functions


-------------------------------------------------------------------


FtpQuote(quote)


FtpSite(site)


FtpSys(variable)



FtpQuote() and FtpSite() pass information to server as the


"site" and "quote" commands do.



FtpSys() returns the name of the operating system that server


is running if no error occurr
ed in the variable "variable"



-------------------------------------------------------------------


Proxy Function


-------------------------------------------------------------------


FtpProxy(host,userid,password,account,pFile,rFile[,"Binar
y" |
"Ascii"])



FtpProxy() copies a file from the named
host/userid/password/account


(account may be empty) to the host specified with the Set
functions.


pFile is name of the file on the named
host/userid/password/account,


rFile is the file on the host specified with the Set functions.


----------------------------------------------------------------------

Utilities Provided

----------------------------------------------------------------------



miniftp.cmd


----
--------



A test program demonstrating the use of the rxFtp package.



?