5,530
社区成员
发帖
与我相关
我的任务
分享
bool file_list()
{
char buf[buf_size] = { 0 };
std::string file_buf = "PWD \r\n";
send(down_socket, file_buf.c_str(), file_buf.length(), 0);
recv(down_socket, buf, sizeof(buf), 0);
std::cout << "当前目录:" << buf << std::endl;
file_buf = "NLST ";
file_buf.append("/e:/EFTP/");
file_buf.append("\r\n");
int r_s = send(down_socket, file_buf.c_str(), file_buf.length(), 0);
memset(buf, 0, sizeof(buf));
recv(down_socket, buf, sizeof(buf), 0);
std::cout << "文件列表:" << buf << std::endl;
return true;