The ftpget() call gets a file from an FTP server.
Syntax
#include <ftpapi.h> int ftpget(host, userid, passwd, acct, local, remote, mode, transfertype) char *host; char *userid; char *passwd; char *acct; char *local; char *remote; char *mode; int transfertype;
Parameters
host
To specify the port number (other than the well-know port) used by the FTP server, code the host name, followed by a blank, then the port number. For example, specify ftpget ("server1 1234",...)
Return Values
The value 0 indicates success; the value -1 indicates an error. The value of ftperrno indicates the specific error. See Return Values for a description of the return codes.
Examples
int rc;rc=ftpget("conypc","jason","ehgr1",NULL,"new.doc","abc.doc","w",T_ASCII);
The system copies the ASCII file abc.doc on the host conypc into the local current working directory as the file new.doc. If the file new.doc already exists in the local current working directory, the contents of the file abc.doc overwrite the file new.doc.