diff --git a/zip_fb2.pl b/zip_fb2.pl index 06f06cb..bd52336 100755 --- a/zip_fb2.pl +++ b/zip_fb2.pl @@ -11,9 +11,11 @@ sub zlist(@); my @list; opendir DIR, "." || die; + while (readdir(DIR)){ if ((-f $_) and ($_ =~ /\.fb2/)){ push @list, $_; } } + closedir (DIR); zlist(@list); @@ -23,9 +25,11 @@ 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; + zip [$item] => "$item.zip", -Level => Z_BEST_COMPRESSION, Minimal => 1, TextFlag => 0, BinModeIn => 1, AutoClose => 1, CanonicalName => 1; + if(length($ZipError) > 0){ printf ("Warning: unable to zip %s - %s\n", $item, $ZipError); }else{ diff --git a/zip_nes_roms.pl b/zip_nes_roms.pl index 809102b..56c952d 100755 --- a/zip_nes_roms.pl +++ b/zip_nes_roms.pl @@ -54,4 +54,3 @@ sub zlist(@){ } } -