update ftpclient

This commit is contained in:
Ambrumf 2023-10-17 00:54:21 +08:00
parent 7c5d473af2
commit 4295885cee
1 changed files with 3 additions and 11 deletions

View File

@ -216,17 +216,9 @@ int Download(char *name)
} }
closesocket(data_fd); closesocket(data_fd);
printf("creating file %s ....\r\n",name); printf("creating file %s ....\r\n",name);
int file=open(name,O_RDWR | O_CREAT); FILE * file = fopen(name,"w");
if(file > 0){ fprintf(file,buf);
ret = PrivWrite(file,buf,strlen(buf)); fclose(file);
if(ret < 0 ){
printf("write failed\r\n");
}
else printf("success!\r\n");
}
else {
printf("create file %s failed\r\n",name);
}
if(buf != NULL){ if(buf != NULL){
free(buf); free(buf);
} }