Skip to content

Commit

Permalink
bug fix for #7 when compressing output
Browse files Browse the repository at this point in the history
  • Loading branch information
sestaton committed Nov 19, 2015
1 parent f2e9907 commit f78b9ea
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
26 changes: 17 additions & 9 deletions bin/pairfq
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use File::Basename;
use Getopt::Long;
use Pod::Usage;

our $VERSION = '0.14.6';
our $VERSION = '0.14.7';

my $script = basename($0, ());
$script = "pairfq" if $script =~ /^-$|stdin/i;
Expand Down Expand Up @@ -568,10 +568,14 @@ sub compress {
my $fso = $fs.".gz" if defined $fs;
my $rso = $rs.".gz" if defined $rs;

IO::Compress::Gzip::gzip $fp => $fpo or die "gzip failed: $IO::Compress::Gzip::GzipError\n";
IO::Compress::Gzip::gzip $rp => $rpo or die "gzip failed: $IO::Compress::Gzip::GzipError\n" if defined $rp;
IO::Compress::Gzip::gzip $fs => $fso or die "gzip failed: $IO::Compress::Gzip::GzipError\n" if defined $fs;
IO::Compress::Gzip::gzip $rs => $rso or die "gzip failed: $IO::Compress::Gzip::GzipError\n" if defined $rs;
IO::Compress::Gzip::gzip($fp, $fpo) ||
die "gzip failed: $IO::Compress::Gzip::GzipError\n";
IO::Compress::Gzip::gzip($rp, $rpo) ||
die "gzip failed: $IO::Compress::Gzip::GzipError\n" if defined $rp;
IO::Compress::Gzip::gzip($fs, $fso) ||
die "gzip failed: $IO::Compress::Gzip::GzipError\n" if defined $fs;
IO::Compress::Gzip::gzip($rs, $rso) ||
die "gzip failed: $IO::Compress::Gzip::GzipError\n" if defined $rs;

unlink $fp;
unlink $rp if defined $rp;
Expand All @@ -584,10 +588,14 @@ sub compress {
my $fso = $fs.".bz2" if defined $fs;
my $rso = $rs.".bz2" if defined $rs;

IO::Compress::Bzip2::bzip2 $fp => $fpo or die "bzip2 failed: $IO::Compress::Bzip2::Bzip2Error\n";
IO::Compress::Bzip2::bzip2 $rp => $rpo or die "bzip2 failed: $IO::Compress::Bzip2::Bzip2Error\n" if defined $rp;
IO::Compress::Bzip2::bzip2 $fs => $fso or die "bzip2 failed: $IO::Compress::Bzip2::Bzip2Error\n" if defined $fs;
IO::Compress::Bzip2::bzip2 $rs => $rso or die "bzip2 failed: $IO::Compress::Bzip2::Bzip2Error\n" if defined $rs;
IO::Compress::Bzip2::bzip2($fp, $fpo) ||
die "bzip2 failed: $IO::Compress::Bzip2::Bzip2Error\n";
IO::Compress::Bzip2::bzip2($rp, $rpo) ||
die "bzip2 failed: $IO::Compress::Bzip2::Bzip2Error\n" if defined $rp;
IO::Compress::Bzip2::bzip2($fs, $fso) ||
die "bzip2 failed: $IO::Compress::Bzip2::Bzip2Error\n" if defined $fs;
IO::Compress::Bzip2::bzip2($rs, $rso) ||
die "bzip2 failed: $IO::Compress::Bzip2::Bzip2Error\n" if defined $rs;

unlink $fp;
unlink $rp if defined $rp;
Expand Down
2 changes: 1 addition & 1 deletion scripts/pairfq_lite.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Getopt::Long;
use Pod::Usage;

our $VERSION = '0.14.6';
our $VERSION = '0.14.7';

my $infile; # input file for 'addinfo', 'splitpairs' and 'makepairs' methods
my $outfile; # output file for 'addinfo' method
Expand Down

0 comments on commit f78b9ea

Please sign in to comment.