1

Initial commit.

This commit is contained in:
eleksir
2016-09-03 22:38:52 +03:00
commit 82b0cfbcc2
22 changed files with 3182 additions and 0 deletions

38
zip_fb2.pl Executable file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/perl
#
# this script conpress all *.fb2 files in current directory with zip
#
use strict;
use warnings "all";
use IO::Compress::Zip qw(:all);
sub zlist(@);
my @list;
opendir DIR, "." || die;
while (readdir(DIR)){
if ((-f $_) and ($_ =~ /\.fb2/)){ push @list, $_; }
}
closedir (DIR);
zlist(@list);
exit 0;
sub zlist(@){
my @list = @_;
my $item;
foreach $item (@list) {
printf ("zipping: %s to %s.zip", $item, $item);
zip [$item] => "$item.zip", -Level => Z_BEST_COMPRESSION, Minimal => 1, TextFlag => 1;
if(length($ZipError) > 0){
printf ("Warning: unable to zip %s - %s\n", $item, $ZipError);
}else{
printf (" and deleting source file\n");
unlink($item);
}
}
}