YedFtpPipe - Send_Cmd

NAME:
Send_Cmd

SYNOPSIS:
SINT Send_Cmd(void *pvO,SCHAR *pscCommand,SINT siCodeOK);

DESCRIPTION:
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\n

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:

cmd1\ncmd2\n

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.

RETURN VALUE:
The method returns YFTSUCCESS in case of right command execution. In case of error, it returns:

YFTWRITERROR
Error in writing data to socket.

YFTNOREPLY
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 ).


http://yed.sourceforge.net