Revised the compression and decompression parameters to run binaries programs.

This commit is contained in:
依瑪貓 2022-03-19 21:39:07 +08:00
parent effc9b8657
commit 9605a118df
2 changed files with 7 additions and 7 deletions

8
reslog
View File

@ -1760,7 +1760,7 @@ sub open_write : method {
($self->{"file"}, $self->{"FH"}) = ($file, $FH); ($self->{"file"}, $self->{"FH"}) = ($file, $FH);
$EXEC = where_is "bzip2" if !defined $EXEC; $EXEC = where_is "bzip2" if !defined $EXEC;
@_ = ($EXEC, "-9f"); @_ = ($EXEC, "-c9f");
@_ = map "\"$_\"", @_ if $^O eq "MSWin32"; @_ = map "\"$_\"", @_ if $^O eq "MSWin32";
$CMD = join " ", @_; $CMD = join " ", @_;
print STDERR " Starting $CMD to file ... " if $VERBOSE > 2; print STDERR " Starting $CMD to file ... " if $VERBOSE > 2;
@ -1831,7 +1831,7 @@ sub open_append : method {
open STDIN, "<&", $STDIN or die "$THIS_FILE: STDIN: $!"; open STDIN, "<&", $STDIN or die "$THIS_FILE: STDIN: $!";
print STDERR "done\n" if $VERBOSE > 2; print STDERR "done\n" if $VERBOSE > 2;
@_ = ($EXEC, "-9f"); @_ = ($EXEC, "-c9f");
@_ = map "\"$_\"", @_ if $^O eq "MSWin32"; @_ = map "\"$_\"", @_ if $^O eq "MSWin32";
$CMD = join " ", @_; $CMD = join " ", @_;
print STDERR " Starting $CMD to file ... " if $VERBOSE > 2; print STDERR " Starting $CMD to file ... " if $VERBOSE > 2;
@ -1859,7 +1859,7 @@ sub open_append : method {
# A whole new file # A whole new file
} else { } else {
@_ = ($EXEC, "-9f"); @_ = ($EXEC, "-c9f");
@_ = map "\"$_\"", @_ if $^O eq "MSWin32"; @_ = map "\"$_\"", @_ if $^O eq "MSWin32";
$CMD = join " ", @_; $CMD = join " ", @_;
print STDERR " Starting $CMD to file ... " if $VERBOSE > 2; print STDERR " Starting $CMD to file ... " if $VERBOSE > 2;
@ -1919,7 +1919,7 @@ sub close : method {
# Create empty compressed content # Create empty compressed content
print STDERR " Applying empty compressed content ... " if $VERBOSE > 2; print STDERR " Applying empty compressed content ... " if $VERBOSE > 2;
$EXEC = where_is "bzip2" if !defined $EXEC; $EXEC = where_is "bzip2" if !defined $EXEC;
@_ = ($EXEC, "-9f"); @_ = ($EXEC, "-c9f");
@_ = map "\"$_\"", @_ if $^O eq "MSWin32"; @_ = map "\"$_\"", @_ if $^O eq "MSWin32";
$CMD = join " ", @_; $CMD = join " ", @_;
# Redirect STDOUT to $FH # Redirect STDOUT to $FH

View File

@ -200,7 +200,7 @@ sub read_file($) {
} else { } else {
my ($PH, $CMD); my ($PH, $CMD);
$CMD = where_is "gzip"; $CMD = where_is "gzip";
$CMD = "\"$CMD\" -cd \"$file\""; $CMD = "\"$CMD\" -cdf \"$file\"";
open $PH, "$CMD |" or die this_file . ": $CMD: $!"; open $PH, "$CMD |" or die this_file . ": $CMD: $!";
$content = join "", <$PH>; $content = join "", <$PH>;
close $PH or die this_file . ": $CMD: $!"; close $PH or die this_file . ": $CMD: $!";
@ -223,7 +223,7 @@ sub read_file($) {
} else { } else {
my ($PH, $CMD); my ($PH, $CMD);
$CMD = where_is "bzip2"; $CMD = where_is "bzip2";
$CMD = "bzip2 -cd \"$file\""; $CMD = "bzip2 -cdf \"$file\"";
open $PH, "$CMD |" or die this_file . ": $CMD: $!"; open $PH, "$CMD |" or die this_file . ": $CMD: $!";
$content = join "", <$PH>; $content = join "", <$PH>;
close $PH or die this_file . ": $CMD: $!"; close $PH or die this_file . ": $CMD: $!";
@ -326,7 +326,7 @@ sub write_file($$) {
} else { } else {
my ($PH, $CMD); my ($PH, $CMD);
$CMD = where_is "bzip2"; $CMD = where_is "bzip2";
$CMD = "\"$CMD\" -9f > \"$file\""; $CMD = "\"$CMD\" -c9f > \"$file\"";
open $PH, "| $CMD" or die this_file . ": $CMD: $!"; open $PH, "| $CMD" or die this_file . ": $CMD: $!";
print $PH $content or die this_file . ": $CMD: $!"; print $PH $content or die this_file . ": $CMD: $!";
close $PH or die this_file . ": $CMD: $!"; close $PH or die this_file . ": $CMD: $!";