免费注册 查看新帖 |

Chinaunix

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

求助:unzip解压的问题,谢谢 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-03-05 16:51 |只看该作者 |倒序浏览
各位大侠,我的程序如下:

        my $FilePath = "" . $doc->getElementsByLocalName('reportFilePath');
                open( AB, ">/home/test/API/$time.zip" )
                  || die("cant open it");
                my $url = get("$FilePath");
                $url =~ s/&/\&/g;
                print AB $url;
后得到一个压缩包2012-02-27.zip。
我用unzip
my $costzip="/home/test/API/2012-02-27\.zip";
my $tempdir ="/home/test/API/";
my $re =system("unzip -o $costzip -d  $tempdir");
但是最后执行结果却是:
Archive:  /home/test/API/2012-02-27.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of/home/test/API/2012-02-27.zip or
       /home/test/API/2012-02-27.zip.zip, and cannot find /home/test/API/2012-02-27.zip.ZIP, period

还请大侠们赐教

论坛徽章:
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 [报告]
发表于 2012-03-05 17:10 |只看该作者
this file is not a zipfile

论坛徽章:
0
3 [报告]
发表于 2012-03-05 17:21 |只看该作者
如果这个包在windows 机器上,可以解压!!
如果我get方法不对,该如何获取网页返回的zip包啊

论坛徽章:
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
4 [报告]
发表于 2012-03-05 18:24 |只看该作者
windows下能解压?往一个后缀为zip文件里面写入一个字符串就能解压?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP