Use the FTP protocol to retrieve a file from a server. Only binary
mode is supported. The filename can include a directory name. Only
use unix style ‘/’ file separators,
not ‘\’.
The file is placed into buf.
buf has maximum size buf_size.
If the file is bigger than this, the
transfer fails and FTP_TOOBIG is returned.
Other error codes listed in the header can also be returned.
If the transfer is successful the number of bytes received is returned.
Use the FTP protocol to send a file to a server.
Only binary
mode is supported. The filename can include a directory name. Only
use unix style ‘/’ file separators,
not ‘\’.
The contents of buf are placed into the file on the
server. If an error occurs one of the codes listed will be returned. If the
transfer is successful zero is returned.
ftp_get() and ftp_put
take a pointer to a function to use for printing
out diagnostic and error messages. This is a sample implementation
which can be used if you don't want to implement the function
yourself.
error will be true when the message to print is an
error message. Otherwise the message is diagnostic, eg. the commands sent
and received from the server.