I have a zip file which is of size larger than 1000MB. I want to split it into multiple compressed zip files depending on size. It will be great if each split zip files are of 10 MB size. My input will be zip file and output should be multiple compressed zip files
#!/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";
Appreciate your help Thanks
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.