|
//处理命令
//PWD
strcat(cmd," WD");
strcat(cmd,"\r\n");
if(!send(sockfd,cmd,strlen(cmd),0))
{
fprintf(stderr,"send error!\n");
exit(1);
}
if((numbytes=recv(sockfd,buf,MAXDATASIZE,0))==-1)
{
fprintf(stderr,"read error!\n");
exit(1);
}
buf[numbytes]='\0';
printf("%s\n",buf);
//FEAT
strcat(cmd," ASV");
strcat(cmd,"\r\n");
if(!send(sockfd,cmd,strlen(cmd),0))
{
fprintf(stderr,"send error!\n");
exit(1);
}
if((numbytes=recv(sockfd,recieve,MAXDATASIZE,0))==-1)
{
fprintf(stderr,"read error!\n");
exit(1);
}
recieve[numbytes]='\0';
printf("%s\n",buf);
我想用PASV命令获得服务器的端口,但是它却给我返回:257 "/" is current directory 不知是什么原因? |
|