免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3448 | 回复: 1
打印 上一主题 下一主题

perl脚本执行ftp,AIX7和suse10操作系统传输码制问题? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-04-24 14:31 |只看该作者 |倒序浏览
以下perl脚本执行ftp到服务端(AIX7)获取文件,bin写在login前面了,语法是否正确? 若不正确,是不是到AIX上默认用bin下载?
  1. my $ftp = Net::FTP -> new ( $ftpServerIP );
  2. if ( defined($ftp) && $ftp )
  3. {
  4.         $ftp -> binary();
  5.         $ftp -> login( $ftpServerUserName, $ftpServerPassword );
  6.         $ftp -> cwd( $ftpServerFilePath );
  7.         $ftp -> pasv(); # passive mode
  8.         @ftpServerFileList = $ftp -> ls($ftpServerFilePattern);

  9.         foreach my $ftpServerFileName (@ftpServerFileList)
  10.         {
  11.                 if( $ftpServerFileName =~ /$todayYMD/ )
  12.                 {
  13.                         print "Debug: Get File Name From CCF Server: $ftpServerFileName .\n";
  14.                         $ftp->get("$ftpServerFileName");
  15.                 }
  16.         }
  17.         $ftp -> quit;
  18. }
复制代码
同样perl脚本ftp到服务端(suse10)获取文件是不是默认用asc下载?

论坛徽章:
78
双子座
日期:2013-10-15 08:50:09天秤座
日期:2013-10-16 18:02:08白羊座
日期:2013-10-18 13:35:33天蝎座
日期:2013-10-18 13:37:06狮子座
日期:2013-10-18 13:40:31双子座
日期:2013-10-22 13:58:42戌狗
日期:2013-10-22 18:50:04CU十二周年纪念徽章
日期:2013-10-24 15:41:34巨蟹座
日期:2013-10-24 17:14:56处女座
日期:2013-10-24 17:15:30双子座
日期:2013-10-25 13:49:39午马
日期:2013-10-28 15:02:15
2 [报告]
发表于 2014-04-24 15:01 |只看该作者
http://search.cpan.org/~shay/libnet-1.25/Net/FTP.pm

The protocol also defines several standard translations which the file can undergo during transfer. These are ASCII, EBCDIC, binary, and byte. ASCII is the default type, and indicates that the sender of files will translate the ends of lines to a standard representation which the receiver will then translate back into their local representation. EBCDIC indicates the file being transferred is in EBCDIC format. Binary (also known as image) format sends the data as a contiguous bit stream. Byte format transfers the data as bytes, the values of which remain the same regardless of differences in byte size between the two machines (in theory - in practice you should only use this if you really know what you're doing).
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP