没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
#include "sys/types.h"
#include "sys/socket.h"
#include "netinet/in.h"
#include "arpa/inet.h"
#include "fcntl.h"
#include "unistd.h"
#include "stdarg.h"
#include "stdio.h"
#include "netdb.h"
int verbose = 1;
FILE *ftpio = NULL;
char buf[4096];
int ftpcmd(int sockftp,char *fmt,...)
{
va_list vp;
int err,len;
if (ftpio == NULL)
{
ftpio = fdopen(sockftp,"r");
if (ftpio == NULL)
return -1;
}
if (fmt)
{
va_start(vp,fmt);
len = vsprintf(buf,fmt,vp);
buf[len++] = '\r';
buf[len++]='\n';
write(sockftp,buf,len);
if (verbose)
#include "sys/socket.h"
#include "netinet/in.h"
#include "arpa/inet.h"
#include "fcntl.h"
#include "unistd.h"
#include "stdarg.h"
#include "stdio.h"
#include "netdb.h"
int verbose = 1;
FILE *ftpio = NULL;
char buf[4096];
int ftpcmd(int sockftp,char *fmt,...)
{
va_list vp;
int err,len;
if (ftpio == NULL)
{
ftpio = fdopen(sockftp,"r");
if (ftpio == NULL)
return -1;
}
if (fmt)
{
va_start(vp,fmt);
len = vsprintf(buf,fmt,vp);
buf[len++] = '\r';
buf[len++]='\n';
write(sockftp,buf,len);
if (verbose)
write(1,buf,len);
}
do
{
if (fgets(buf,sizeof(buf),ftpio) == NULL)
return -1;
if (verbose)
printf(buf);
} while(buf[3] == '-');
sscanf(buf,"%d",&err);
return err;}
int ftp(char *host,char *user,char *pass,char *filename,char *savefile)
{
int sockftp = -1,sockdata = -1,sockxfer = -1;
struct sockaddr_in addr;
unsigned long hostip;
int len,tmp,err;
int retval = -1;
int savefd;
unsigned char *c,*p;
struct hostent *he;
hostip = inet_addr(host);
if (hostip == -1)
{
he = gethostbyname(host);
if (he == NULL)
return -1;
hostip = * (unsigned long *)he->h_addr;
}
}
do
{
if (fgets(buf,sizeof(buf),ftpio) == NULL)
return -1;
if (verbose)
printf(buf);
} while(buf[3] == '-');
sscanf(buf,"%d",&err);
return err;}
int ftp(char *host,char *user,char *pass,char *filename,char *savefile)
{
int sockftp = -1,sockdata = -1,sockxfer = -1;
struct sockaddr_in addr;
unsigned long hostip;
int len,tmp,err;
int retval = -1;
int savefd;
unsigned char *c,*p;
struct hostent *he;
hostip = inet_addr(host);
if (hostip == -1)
{
he = gethostbyname(host);
if (he == NULL)
return -1;
hostip = * (unsigned long *)he->h_addr;
}
剩余5页未读,继续阅读
资源评论
- weixin_384278882017-06-13假的 分还这么高 骗人的 不要下了
- u0110089052013-12-27当时要找的是客户端和服务器端。资源不错,但是用不上10分吧应该。。。
艺林1943
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功