FTPc_RecvFile

Receives a file into the file system.

Files

ftp-c.h/ftp-c.c

Prototype

          CPU_BOOLEAN  FTPc_RecvFile (FTPc_CONN  *p_conn,
                                      CPU_CHAR   *p_remote_file_name,
                                      CPU_CHAR   *p_local_file_name,
                                      FTPc_ERR   *p_err);


Arguments

p_conn

Pointer to FTPc Connection object.

p_remote_file_name 

Pointer to name of the file on the remote FTP server.

local_file_name 

Pointer to  name of the file in the local file system.

p_err 

Pointer to variable that will receive the return error code from this function:

FTPc_ERR_NONE
FTPc_ERR_TX_CMD
FTPc_ERR_RX_CMD_RESP_FAIL
FTPc_ERR_FILE_NOT_FOUND
FTPc_ERR_FAULT
FTPc_ERR_FILE_OPEN_FAIL 

Returned Values

DEF_OK,     File successfully received;
DEF_FAIL, otherwise.

Required Configuration

  • This function can only be used when FTPc_CFG_USE_FS is set tot DEF_ENABLED.

Notes / Warnings

None.

Example Usage

FTPc_CONN    conn;
CPU_BOOLEAN  result;
FTPc_ERR     err;
           
result = FTPc_RecvFile(&conn,
                       "file_remote",
                       "\\file_local",
                       &err);
if (result != DEF_OK) {
	printf("FTPc_RecvBuf() failed.\n\r");
}