我想在windows中合并已分割的压缩文件。在linux系统中,我可以通过
$prefixfiles = "splittedfiles*"
$outputfile = "combined.zip"
@output = `cat $prefixfiles > $outputfile`但是,在windows中,当我想要复制相同的文件时(使用Exutils),我看到一个损坏的zip文件,上面写着“归档的意外结束”
use ExtUtils::Command;
$prefixfiles = "splittedfiles*"
$outputfile = "combined.zip"
@output = `perl -MExtUtils::Command -e cat $prefixfiles > $outputfile`我以前试过使用binmode
binmode "C:\linktofile\splittedfilesaa";有人能帮忙吗?
发布于 2014-07-24 06:25:19
更简单的答案。将cat替换为type,并将stderr重定向到nul:(等效于/dev/null)
@output = `type $prefixfiles > $outputfile 2>nul:`发布于 2014-07-24 06:14:26
在Windows shell中,可以使用copy命令将文件与+操作符连接起来。示例将file1.txt、file2.txt和file3.txt组合为"final.txt“文件:
copy /b /y file1.txt+file2.txt+file3.txt final.txt/b选项是向Windows/DOS指示文件应被视为二进制文件(" as - is "),而不是在复制操作期间插入或重新解释行尾字符。
/y表示“不要提示覆盖确认”
将您的perl脚本与@output和$prefixfiles变量一起作为许可海盗来做同样的事情。
https://stackoverflow.com/questions/24926270
复制相似问题