YedFtpPipe - Send_Cmd
SINT Send_Cmd(void *pvO,SCHAR *pscCommand,SINT siCodeOK);
The method sends the generic command pscCommand to ftp child, and waiting for siCodeOK from FTP server as right response code. pscCommand buffer has the form:
string is a user command available in ftp application used for driving FTP connection, like 'binary' or 'hash', that must be terminated with the '\n' character. It is possible to concatenate more commands, as long as they are separated with '\n' character, like this:
In this example, remember that the subsequent invocation of Get_Cmd_Duration method returns times about the only cmd2 command.
If you need to read any server response buffer, you must invoke Get_Cmd_Status method after the invocation of Send_Cmd.
The method returns YFTSUCCESS in case of right command execution. In case of error, it returns:
Error in writing data to socket.
Timeout error in data reply from child.
In all other cases the method receives a bad response code from child, it returns this code. The meaning of these codes is explained in RFC documents about FTP protocol ( RFC 959 and others ).