- 浏览: 30230 次
最新评论
sco unix ftp 源代码
- 博客分类:
- 技术杂绘
sco unix ftp 源代码
2012年01月08日
sco unix ftp 源代码如下代码可以实现 unix to unix 的文件发送,但不通实现unix to windows之间的发送,各位指点指点。
#include ;
#include ;
#define NORMAL0
#define ABNORMAL 1
#define ON 1
#define OFF 0
main (argc, argv)
int argc;
char *argv[];
{
FTPINFO ftpinfo;
void usage(), check_n_close();
char *progname;
char *host;
progname = (char *) argv;
if ( argc error: ftp_prconnect failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* send user name to the remote server.
*/
if (ftp_user( &ftpinfo, "bank" ) error: ftp_user failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* send user password to the remote server.
*/
if (ftp_passwd ( &ftpinfo, "" ) error: ftp_passwd failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* set the idle time for this connection.
*/
if (ftp_idle ( &ftpinfo, "7200" ) error: ftp_idle failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* do a 'cd' on the remote ftp server.
*/
if (ftp_chdir( &ftpinfo, "winnt" ) error: ftp_chdir failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* do a 'pwd' on the remote ftp server.
*/
if (ftp_pwd ( &ftpinfo ) error: ftp_pwd failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* set transfer mode to ascii.
*/
if (ftp_ascii ( &ftpinfo ) error: ftp_ascii failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* set transfer mode to binary.
*/
if (ftp_binary ( &ftpinfo ) error: ftp_binary failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* set transfer mode back to ascii - using ftp_settype.
*/
if (ftp_settype ( &ftpinfo, ASCII ) error: ftp_settype failed in ascii mode.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* set transfer mode back to binary - using ftp_settype.
*/
if (ftp_settype ( &ftpinfo, BINARY ) error: ftp_settype failed in binary mode.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* make a directory under /tmp on the server.
*/
if (ftp_mkdir ( &ftpinfo, "prem" ) error: ftp_mkdir failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* change the mode of the directory created above.
*/
if (ftp_site ( &ftpinfo, "chmod 775 prem" ) error: ftp_site failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* remove the directory created above.
*/
if (ftp_rmdir ( &ftpinfo, "prem" ) error: ftp_rmdir failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* quit the FTP session decently.
*/
if (ftp_bye( &ftpinfo ) error: ftp_bye failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* use ftp_login to login into the remote ftp server and quit.
*/
if (ftp_login ( &ftpinfo, host, "bank", "", NULL ) error: ftp_login failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* do a 'put' to the remote host.
*/
if (ftp_putfile ( &ftpinfo, "/tmp/passwd", "c:/passwd" ) error: ftp_putfile failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
else {
printf("transfer speed: \n");
printf("\t\tbytes transferred = %ld\n",
ftpinfo.speed.size_bytes);
printf("\t\ttime taken = %.2g seconds\n",
ftpinfo.speed.seconds);
printf("\t\trate = %.2g Kbytes/s\n",
ftpinfo.speed.kbs);
}
/*
* set transfer mode back to ascii - using ftp_settype.
*/
if (ftp_settype ( &ftpinfo, ASCII ) error: ftp_settype failed in ascii mode.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* do a 'get' from the remote host.
*/
if (ftp_getfile ( &ftpinfo, "/tmp/passwd","c:/passwd" )error: ftp_getfile failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
else {
printf("transfer speed: \n");
printf("\t\tbytes transferred = %ld\n",
ftpinfo.speed.size_bytes);
printf("\t\ttime taken = %.2g seconds\n",
ftpinfo.speed.seconds);
printf("\t\trate = %.2g Kbytes/s\n",
ftpinfo.speed.kbs);
}
/*
* list /tmp on remote host to file /tmp/test.
*/
if (ftp_dir ( &ftpinfo, "/tmp", "/tmp/test" ) error: ftp_dir failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* list /tmp on remote host to stdout.
*/
if (ftp_dir ( &ftpinfo, "/tmp", NULL ) error: ftp_dir failed to write to stdout.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* delete the file on the remote host.
*/
if (ftp_del ( &ftpinfo, "/tmp/asciifile" ) error: ftp_del failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* quit the FTP sessions decen
关于DNS的负载均衡的问题 tly.
*/
if (ftp_bye( &ftpinfo ) error: ftp_bye failed.\n");
(void) check_n_close ( &ftpinfo, ABNORMAL );
}
/*
* we're done with our job...so exit the program gracefully.
*/
(void) check_n_close ( &ftpinfo, NORMAL );
}
void
usage(progname)
char *progname;
{
printf("usage: %s ;\n", progname);
exit (1);
}
void
check_n_close ( ftpinfo, status )
FTPINFO *ftpinfo;
int status;
{
if (ftpinfo ->; sockfd >;= 0)
close (ftpinfo ->; sockfd);
if (status == ABNORMAL)
printf("error: %s\n", ftpinfo ->; ftp_msg);
else
printf("success: %s\n", ftpinfo ->; ftp_msg);
printf("final reply from server: %d\n", ftpinfo ->; reply);
fflush ( stdout );
exit (status);
}sco unix ftp 源代码oksco unix ftp 源代码怎么样编译。sco unix ftp 源代码ccprog.c -o prog -lftpsco unix ftp 源代码加为精华吧sco unix ftp 源代码难道没有人作过吗?sco unix ftp 源代码我没用过ftp库函数,用普通socket函数到是写过,
效果还不错,一直在用!sco unix ftp 源代码请问老大, 我的机器怎么有一个提示/usr/lib/libftp.a 的提示呀http://www.hld1001.com!暖奶器
编译没有其他的错误,希望指点一二,谢谢!sco unix ftp 源代码各位老大:编译的问题解决了,命令如下:cc -o ftp ftp.c -llftp -lsocket
可是运行时出现错误如下:
error: fopen failed to open in "r" mode for sending
final reply from server: 150
或
error: ftp _ftpfile failed
ferror:data connection failed
inal reply from server: 553
那位能帮我解决!这里先行谢过了!sco unix ftp 源代码man ftp看到最后就是上面的例程了,只有unixware下能够使用,必须链接libftp.a,其他系统用不了的。
发表评论
-
C/E盘各目录及Private文件夹详解
2012-01-20 10:59 739C/E盘各目录及Private文件夹详解 2011年09月2 ... -
中航工业洪都交付C919大飞机机身等直段部段
2012-01-20 10:59 858中航工业洪都交付C919大 ... -
I2C―― C程序
2012-01-20 10:59 1170I2C―― C程序 2012年01月09日 一、 ... -
C# 绑定值设定格式
2012-01-20 10:59 822C# 绑定值设定格式 2012年01月17日 1。日期格 ... -
boost log 使用碰到的问题.
2012-01-19 15:54 2148boost log 使用碰到的问题. 2011年12月30日 ... -
Solaris 10 U5的一个Xerror,是否是显卡未识别?
2012-01-19 15:54 1065Solaris 10 U5的一个Xerror,是否是显卡未识别 ... -
mysql pid file not found and can't connect to mysql through socket mysql.sock
2012-01-19 15:54 670mysql pid file not found and ca ... -
用断言风格写验证平台的基本方法
2012-01-19 15:54 1145用断言风格写验证平台的基本方法 22小时前 终于在Sy ... -
山寨宝马成卖点 中华V5市场展望
2012-01-17 05:47 560山寨宝马成卖点 中华V5 ... -
长安逸动 售价或与宝骏630持平
2012-01-17 05:47 718长安逸动 售价或与宝骏 ... -
商业地产招商的十大误区(转)
2012-01-17 05:47 593商业地产招商的十大误区(转) 2011年11月25日 很 ... -
现场奖品领取:11月24日,北语,法国美酒与日本寿司的对话
2012-01-17 05:40 715现场奖品领取:11月24日,北语,法国美酒与日本寿司的对话 ... -
礼制”思想的阐述
2012-01-16 04:33 767礼制”思想的阐述 2010 ... -
我为什么要找河南女人做老婆
2012-01-16 04:33 16265我为什么要找河南女人做老婆 2010年12月29日 ... -
[逸闻趣谈]中国42个城市在一个班级里的职务-----看到台北,我自己都忍不住笑了
2012-01-16 04:33 621[逸闻趣谈]中国42个城市在一个班级里的职务-----看到台北 ... -
南怀瑾-解读佛教的孝道(下)
2012-01-16 04:33 515南怀瑾-解读佛教的孝道(下) 2012年01月05日 ...
相关推荐
scounix,unix操作系统简介scounix,unix操作系统简介scounix,unix操作系统简介scounix,unix操作系统简介scounix,unix操作系统简介scounix,unix操作系统简介scounix,unix操作系统简介scounix,unix操作系统简介scounix,...
sco unix 5.0.7注册码,以及sco opensever unix 5.0.7实用方法
SCO UNIX作为一个技术成熟的商用网络操作系统,广泛地应用在金融、保险、邮电等行 业的实时业务当中。任何应用系统在实际操作中,都会或多或少地出现一些故障,要求 系统管理员能够及时地分析原因排除故障,如果系统...
UNIX 下 SCO TCPIP ftp 命令表.doc
惠普 SCO UNIX操作系统,银行系统内部培训资料
SCO UNIX 实用教程,用得着就下载吧
SCO UNIX实用教程,unix的初级教程
scounix系列号、SOCopenserver 5.7
SCO UNIX 使用教材
SCO UNIX VI 基本命令,总结的一些UNIX中的VI命令
sco unix 英文版 操作手册 ,原始系统的说明 ,针对 sco unix 5.0.x的说明手册
详细讲解了SCO UNIX系统的安装过程,并配有图解,简单易学!
SCO UNIX 赛埔中文,中文龙马,远程桌面,WBXL,要其它的软件可联系,本人颇通各种无盘和终端,有需要的朋友请联系,对SCO UNIX 才刚学习......
SCOUNIX配置、命令指南
SCOUNIX 简介
SCO Unix 5.0.5 下网卡和协议安装调试.doc
sco unix 5 和 6 注册机,可以生成安装序列和在操作系统中进行注册。
中软出品 sco unix open server第1课教程,flv格式,总共15课