Library: FTP support (OMFTP)
The FTPConnection opaque data type allows you to create a connection to an FTP server. Once that connection is made, you can send data to and retrieve data from the FTP server.
The OmniMark FTP dynamic link library file ("omftp.dll" or "omftp.so") creates the FTPConnection data type. The related include file ("omftp.xin") defines the interface to that data type. To use FTPConnection data types in your program, you must include the following declaration and include statement in your program:
Within your program, you can create as many instances of the FTPConnection data type as you require by declaring global and local variables of type "FTPConnection". For example:
include "omftp.xin" global FTPConnection my-ftp-1 global FTPConnection my-ftp-2 process local FTPConnection my-ftp-3 local FTPConnection my-ftp-4
Once you have declared your FTPConnection variables, you can use them in the FTPConnectionOpen function from the OmniMark FTP library to create connections to FTP servers. For example:
include "omftp.xin" process local FTPConnection my-ftp-connection set my-ftp-connection to FTPConnectionOpen server "banzai.com" user "buckaroo" password "watermelon"
Assuming that no errors occur when establishing the connection to the FTP server, you can now send data to and receive data through the connection by using the other functions in the OmniMark FTP library.
The FTPConnection data type is not copyable. This means that when you set the value of one FTPConnection variable to the value of another FTPConnection variable, you end up with two variables pointing at the same external object. You are able to manipulate both variables, but you are performing those manipulations on the same FTP connection, whether you use the original FTPConnection variable or its copy.