说下情况
发送文件
while(sendfd=fread(ch,sizeof(char),256,fp)>0)
{
send(sockfd,ch,sendfd,0);
}
fclose(fp);
close(sockfd);
接收并写入文件
do{
if((recvfd=recv(acceptfd,ch,256,0))==-1)
{
printf("error in recv.\n";
break;
}
fwrite(ch,1,sizeof(ch),fp);
}while(recvfd > 0);
不明白接收回来后为什么会有乱码现象,还有这个nonel是什么意思
如下:
/usr/zhao1/file/ftp.sh 1>/usr/zhao1/file/filename.txt 2>&1
cat /usr/zhao1/file/filename.txt |ftp -n
mv /usr/zhao1/*.dmp /usr/zhao1/mas.exp
rm /usr/zhao1/file/filename.txt
下面跟乱码
"copy_file.txt" [noeol] 6L, 256C