client is written in C by yourself
-sharpdefine BUFFER_SIZE 1024
char recv_buffer[BUFFER_SIZE];
char send_buffer[BUFFER_SIZE];
// ...
else if (start_with(cmd_read, "cd"))
{
char *token;
const char delim[2] = " \t";
token = strtok(cmd_read, delim);
char *path = strtok(NULL, delim);
if (path == NULL)
{
printf("please input the path\n");
continue;
}
sprintf(send_buffer, "CWD %s\r\n", path);
send_cmd(client_socket, send_buffer);
length = get_respond(client_socket, recv_buffer);
printf("%s", recv_buffer);
}
ftp server Why should I send an error message twice? How to deal with this?
Github source
PS:
FTP server I use windows