perl - 如何使用 Perl 拆分 zip 文件
问题描述
我有一个大小超过 1000MB 的 zip 文件。我想根据大小将其拆分为多个压缩的 zip 文件。如果每个拆分的 zip 文件大小为 10 MB,那就太好了。我的输入将是 zip 文件,输出应该是多个压缩的 zip 文件
#!/usr/bin/env perl
use strict;
use utf8;
use Archive::Zip qw(:ERROR_CODES :CONSTANTS);
my $file = $ARGV[0];
my $filesize = -s $file;
print "Size: $filesize\n";
感谢您的帮助 谢谢
解决方案
You can use Splitted Zip for this.
Refer to https://www.perlmonks.org/bare/?node_id=534408
Its purpose is to arrange the files to be sent in order to produce multiple ZIP archives, each of which remains valid and self-contained.
You can also use "split-archive" functionality of "zip" itself
$ zip -r -s 10m file.zip directory/ => using the "--split-size" option.
推荐阅读
- javascript - 迭代大量对象是更改/添加值的“正确方法”吗?
- python - 对数据库执行生成的密码
- linux - 如何将来自vim的unix命令与在拆分窗口中打开的所有文件相关联?
- amazon-web-services - AWS CloudFormation:默认 VPC“vpc”中不存在安全组“sg-”
- python - 熊猫:列中的行
- python - 每次我运行代码时,Cnn + word2vec 模型都会不断改变准确性
- tensorflow - 如何在给定时间内睡觉和唤醒谷歌珊瑚开发板
- python-3.x - 如何在 KivyMD 中添加启动画面
- c++ - 有没有办法用 C 宏在两个列表上做笛卡尔积?
- javascript - 在反应中加载three.js纹理作为base64字符串