Skip to content

Commit

Permalink
Windows use 'NUL' instead of '/dev/null', so added the option
Browse files Browse the repository at this point in the history
to use it when running in Windows
  • Loading branch information
fjossandon committed Dec 27, 2013
1 parent 2eaf9da commit 52ec7b5
Show file tree
Hide file tree
Showing 40 changed files with 93 additions and 58 deletions.
3 changes: 2 additions & 1 deletion lib/Bio/Factory/EMBOSS.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -257,9 +257,10 @@ sub _program_list {
my ($self) = @_; my ($self) = @_;
if( $^O =~ /Mac/i ) { return; } if( $^O =~ /Mac/i ) { return; }
{ {
my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
local * SAVERR; local * SAVERR;
open SAVERR, ">&STDERR"; open SAVERR, ">&STDERR";
open STDERR, ">/dev/null"; open STDERR, ">$null";
open(WOSSOUT, "wossname -auto |") || return; open(WOSSOUT, "wossname -auto |") || return;
open STDERR, ">&SAVERR"; open STDERR, ">&SAVERR";


Expand Down
5 changes: 3 additions & 2 deletions lib/Bio/Tools/Run/Alignment/Amap.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -462,8 +462,9 @@ sub _setparams {
#FIXME: This may be only for *nixes. Double check in other OSes #FIXME: This may be only for *nixes. Double check in other OSes
$param_string .= " > ".$self->outfile_name; $param_string .= " > ".$self->outfile_name;


if ($self->verbose < 0) { if ($self->verbose < 0) {
$param_string .= ' 2> /dev/null'; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$param_string .= " 2> $null";
} }
return $param_string; return $param_string;
} }
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Alignment/Clustalw.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -736,7 +736,8 @@ sub _run {


$self->debug( "Program ".$self->executable."\n"); $self->debug( "Program ".$self->executable."\n");
my $commandstring = $self->executable."$instring"."$param_string"; my $commandstring = $self->executable."$instring"."$param_string";
$commandstring .= ' 1>/dev/null' if $quiet; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$commandstring .= " 1>$null" if $quiet;
$self->debug( "clustal command = $commandstring"); $self->debug( "clustal command = $commandstring");


my $status = system($commandstring); my $status = system($commandstring);
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Alignment/Gmap.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -324,11 +324,12 @@ EOM
sub _run { sub _run {
my $self = shift; my $self = shift;


my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
my $str = $self->executable; my $str = $self->executable;
$str .= ' -d' . ($self->genome_db() || 'NHGD_R36'); $str .= ' -d' . ($self->genome_db() || 'NHGD_R36');
$str .= ' ' . ($self->flags() || '-f 9 -5 -e'); $str .= ' ' . ($self->flags() || '-f 9 -5 -e');
$str .= ' ' . $self->input_file(); $str .= ' ' . $self->input_file();
$str .= ' 2> /dev/null'; $str .= " 2> $null";
$str .= '; rm -f ' . $self->input_file(); $str .= '; rm -f ' . $self->input_file();
$self->debug("gmap command = $str\n"); $self->debug("gmap command = $str\n");


Expand Down
5 changes: 3 additions & 2 deletions lib/Bio/Tools/Run/Alignment/Kalign.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -466,8 +466,9 @@ sub _setparams {
} }
$param_string .= " -out ".$self->outfile_name; $param_string .= " -out ".$self->outfile_name;


if ($self->quiet() || $self->verbose < 0) { if ($self->quiet() || $self->verbose < 0) {
$param_string .= ' 2> /dev/null'; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$param_string .= " 2> $null";
} }
return $param_string; return $param_string;
} }
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Alignment/Lagan.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ sub _runlagan {


if (($self->silent || $self->quiet) && if (($self->silent || $self->quiet) &&
($^O !~ /os2|dos|MSWin32|amigaos/)) { ($^O !~ /os2|dos|MSWin32|amigaos/)) {
$command_string .= ' > /dev/null 2> /dev/null'; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$command_string .= " > $null 2> $null";


} }


Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Alignment/MAFFT.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -524,7 +524,8 @@ sub _setparams {


if ($self->quiet() || $self->verbose < 0) { if ($self->quiet() || $self->verbose < 0) {
$param_string .= " --quiet"; $param_string .= " --quiet";
$outputstr .= ' 2> /dev/null'; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$outputstr .= " 2> $null";
} }
return ($param_string, $outputstr); return ($param_string, $outputstr);
} }
Expand Down
7 changes: 4 additions & 3 deletions lib/Bio/Tools/Run/Alignment/MSAProbs.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -681,10 +681,11 @@ sub _setparams {
}else{ }else{
$self->outfile_name($self->outfile); $self->outfile_name($self->outfile);
} }
$param_string .= ' -v' if $self->verbose > 0; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$param_string .= ' -v' if $self->verbose > 0;
$param_string .= ' >'.$self->outfile_name; $param_string .= ' >'.$self->outfile_name;
$param_string .= ' 2>/dev/null' if $self->quiet && $param_string .= " 2>$null" if $self->quiet &&
$self->verbose < 1; $self->verbose < 1;
$self->arguments($param_string); $self->arguments($param_string);
return $param_string; return $param_string;
} }
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Alignment/Muscle.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -562,7 +562,8 @@ sub _setparams {
$param_string .= " -out " . $self->outfile_name; $param_string .= " -out " . $self->outfile_name;


if ( $self->quiet() || $self->verbose < 0 ) { if ( $self->quiet() || $self->verbose < 0 ) {
$param_string .= ' 2> /dev/null'; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$param_string .= " 2> $null";
} }
return $param_string; return $param_string;
} }
Expand Down
5 changes: 3 additions & 2 deletions lib/Bio/Tools/Run/Alignment/Probalign.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -451,8 +451,9 @@ sub _setparams {
#FIXME: This may be only for *nixes. Double check in other OSes #FIXME: This may be only for *nixes. Double check in other OSes
$param_string .= " > ".$self->outfile_name; $param_string .= " > ".$self->outfile_name;


if ($self->verbose < 0) { if ($self->verbose < 0) {
$param_string .= ' 2> /dev/null'; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$param_string .= " 2> $null";
} }
return $param_string; return $param_string;
} }
Expand Down
5 changes: 3 additions & 2 deletions lib/Bio/Tools/Run/Alignment/Probcons.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -485,8 +485,9 @@ sub _setparams {
#FIXME: This may be only for *nixes. Double check in other OSes #FIXME: This may be only for *nixes. Double check in other OSes
$param_string .= " $infilename > ".$self->outfile_name; $param_string .= " $infilename > ".$self->outfile_name;


if ($self->verbose < 0) { if ($self->verbose < 0) {
$param_string .= ' 2> /dev/null'; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$param_string .= " 2> $null";
} }
return $param_string; return $param_string;
} }
Expand Down
5 changes: 3 additions & 2 deletions lib/Bio/Tools/Run/Alignment/Proda.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -455,8 +455,9 @@ sub _setparams {
#FIXME: This may be only for *nixes. Double check in other OSes #FIXME: This may be only for *nixes. Double check in other OSes
$param_string .= " > ".$self->outfile_name; $param_string .= " > ".$self->outfile_name;


if ($self->verbose < 0) { if ($self->verbose < 0) {
$param_string .= ' 2> /dev/null'; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$param_string .= " 2> $null";
} }
return $param_string; return $param_string;
} }
Expand Down
4 changes: 2 additions & 2 deletions lib/Bio/Tools/Run/Alignment/Sim4.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ sub _run {
my $outfile = $self->outfile(); my $outfile = $self->outfile();
my $commandstring = $self->executable." $infile1 $infile2 $param_string > $outfile"; my $commandstring = $self->executable." $infile1 $infile2 $param_string > $outfile";
if($self->quiet || $self->silent || ($self->verbose < 0)){ if($self->quiet || $self->silent || ($self->verbose < 0)){
$commandstring .= " 2>/dev/null"; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$commandstring .= " 2>$null";
} }
$self->debug( "Sim4 command = $commandstring"); $self->debug( "Sim4 command = $commandstring");
my $status = system($commandstring); my $status = system($commandstring);
Expand Down Expand Up @@ -391,4 +392,3 @@ sub _setparams {
} }


1; # Needed to keep compiler happy 1; # Needed to keep compiler happy

7 changes: 4 additions & 3 deletions lib/Bio/Tools/Run/Alignment/StandAloneFasta.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ sub run {
-format=>"fasta"); -format=>"fasta");
} else { } else {
if ( $self->verbose() < 0) { if ( $self->verbose() < 0) {
$para .= ' >/dev/null 2>/dev/null'; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$para .= " >$null 2>$null";
} else { } else {
$self->debug("Going to execute: $para"); $self->debug("Going to execute: $para");
} }
Expand Down Expand Up @@ -351,7 +352,8 @@ sub run {
-format=>"fasta"); -format=>"fasta");
} else { } else {
if ( $self->verbose() < 0) { if ( $self->verbose() < 0) {
$para .= ' >/dev/null 2>/dev/null'; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$para .= " >$null 2>$null";
} else { } else {
$self->debug("Going to execute: $para"); $self->debug("Going to execute: $para");
} }
Expand Down Expand Up @@ -549,4 +551,3 @@ sub _setparams {


1; 1;
__END__ __END__
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Coil.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ sub _run {
my ($tfh1,$outfile) = $self->io->tempfile(-dir=>$self->tempdir()); my ($tfh1,$outfile) = $self->io->tempfile(-dir=>$self->tempdir());
my $str =$self->executable." -f < ".$self->{'input'}." > ".$outfile; my $str =$self->executable." -f < ".$self->{'input'}." > ".$outfile;
if($self->quiet || $self->verbose <=0 || $self->silent){ if($self->quiet || $self->verbose <=0 || $self->silent){
$str.=" 2>/dev/null"; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$str.=" 2>$null";
} }
my $status = system($str); my $status = system($str);
$self->throw( "Coil call ($str) crashed: $? \n") unless $status==0; $self->throw( "Coil call ($str) crashed: $? \n") unless $status==0;
Expand Down
5 changes: 2 additions & 3 deletions lib/Bio/Tools/Run/FootPrinter.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ sub _run {
$self->debug("FootPrinter command = $cmd_str"); $self->debug("FootPrinter command = $cmd_str");


if ($self->verbose <=0){ if ($self->verbose <=0){
$cmd_str.=" >&/dev/null > /dev/null"; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$cmd_str.= " >&$null > $null";
} }


# will do brute-force clean up of junk files generated by FootPrinter # will do brute-force clean up of junk files generated by FootPrinter
Expand Down Expand Up @@ -544,5 +545,3 @@ sub _setinput {
=cut =cut


1; 1;


3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Genscan.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ sub _run {
$str.=" -v "; $str.=" -v ";
} }
if($self->quiet){ if($self->quiet){
open(STDERR,">/dev/null"); my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
open(STDERR,">$null");
} }
unless (open(GENSCAN, "$str |")){ unless (open(GENSCAN, "$str |")){
$self->warn("Cannot run $str"); $self->warn("Cannot run $str");
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Infernal.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -922,7 +922,8 @@ sub to_exe_string {
if ($prog eq 'cmalign') { if ($prog eq 'cmalign') {
push @{$args{switch}}, '-q' if !exists $params{q}; push @{$args{switch}}, '-q' if !exists $params{q};
} else { } else {
push @{$args{redirect}}, '> /dev/null'; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
push @{$args{redirect}}, "> $null";
} }
} }


Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/MCS.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ sub _setparams {
-switches => \@SWITCHES, -switches => \@SWITCHES,
-dash => 1); -dash => 1);


$param_string .= ' 1>/dev/null' if $self->quiet; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$param_string .= " 1>$null" if $self->quiet;


return $param_string; return $param_string;
} }
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Match.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ sub _setparams {
my $param_string = $self->SUPER::_setparams(-switches => \@SWITCHES, my $param_string = $self->SUPER::_setparams(-switches => \@SWITCHES,
-dash => 1); -dash => 1);


$param_string .= ' 1>/dev/null' if $self->quiet; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$param_string .= " 1>$null" if $self->quiet;


return $param_string; return $param_string;
} }
Expand Down
4 changes: 3 additions & 1 deletion lib/Bio/Tools/Run/Meme.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ sub _setparams {
-dash => 1); -dash => 1);


$param_string .= " > $outfile"; $param_string .= " > $outfile";
$param_string .= ' 2> /dev/null' if $self->quiet || $self->verbose < 0;
my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$param_string .= " 2> $null" if $self->quiet || $self->verbose < 0;


return $param_string; return $param_string;
} }
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Phrap.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -397,7 +397,8 @@ sub _run {
my $options = join ' ', @{$self->_translate_params()}; my $options = join ' ', @{$self->_translate_params()};


# Usage: phrap seq_file1 [seq_file2 ...] [-option value] [-option value] ... # Usage: phrap seq_file1 [seq_file2 ...] [-option value] [-option value] ...
my $str = "$exe $options $fasta_file 1> $output_file 2> /dev/null"; my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
my $str = "$exe $options $fasta_file 1> $output_file 2> $null";
if ($self->verbose() >= 0) { if ($self->verbose() >= 0) {
$self->debug( "$exe command = $str\n" ); $self->debug( "$exe command = $str\n" );
}; };
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Phylo/FastTree.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ sub _setparams {
} }
$param_string .= " $infile > " . $self->outfile_name; $param_string .= " $infile > " . $self->outfile_name;


$param_string .= ' 2> /dev/null' if ( $self->quiet() || $self->verbose < 0 ); my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
$param_string .= " 2> $null" if ( $self->quiet() || $self->verbose < 0 );


$param_string; $param_string;
} }
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Phylo/Gumby.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -411,14 +411,15 @@ sub _run {
sub _setparams { sub _setparams {
my ($self, $aln_file, $tree_file) = @_; my ($self, $aln_file, $tree_file) = @_;


my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
my $param_string = ' '.$tree_file; my $param_string = ' '.$tree_file;
$param_string .= ' '.$aln_file; $param_string .= ' '.$aln_file;
$param_string .= $self->SUPER::_setparams(-params => \@PARAMS, $param_string .= $self->SUPER::_setparams(-params => \@PARAMS,
-switches => \@SWITCHES, -switches => \@SWITCHES,
-dash => 1,); -dash => 1,);
$param_string .= ' -o out'; $param_string .= ' -o out';
$param_string .= ' 2>&1'; $param_string .= ' 2>&1';
$param_string .= ' 1>/dev/null' if $self->quiet; $param_string .= " 1>$null" if $self->quiet;


return $param_string; return $param_string;
} }
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Phylo/Hyphy/FEL.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ essentially lifted from the python wrapper or provided by the author.




sub valid_values { sub valid_values {
my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
return return
( (
{'geneticCode' => [ "Universal","VertebratemtDNA","YeastmtDNA","Mold/ProtozoanmtDNA", {'geneticCode' => [ "Universal","VertebratemtDNA","YeastmtDNA","Mold/ProtozoanmtDNA",
Expand All @@ -139,7 +140,7 @@ sub valid_values {
{ "Default" => undef } ] { "Default" => undef } ]
}, },
{'temptreefile' => undef }, # tree file goes here {'temptreefile' => undef }, # tree file goes here
{'Model Fit Results' => [ '/dev/null'] }, # this will not work under Windows {'Model Fit Results' => [ $null] }, # Windows have NUL instead of /dev/null
{'dN/dS bias parameter' => [ { "Estimate dN/dS only" => undef }, {'dN/dS bias parameter' => [ { "Estimate dN/dS only" => undef },
{ "Neutral" => undef }, { "Neutral" => undef },
{ "Estimate" => undef }, { "Estimate" => undef },
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Phylo/Hyphy/SLAC.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ essentially lifted from the python wrapper or provided by the author.




sub valid_values { sub valid_values {
my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
return return
( (
{'geneticCode' => [ "Universal","VertebratemtDNA","YeastmtDNA","Mold/ProtozoanmtDNA", {'geneticCode' => [ "Universal","VertebratemtDNA","YeastmtDNA","Mold/ProtozoanmtDNA",
Expand All @@ -138,7 +139,7 @@ sub valid_values {
{ "Default" => undef } ] { "Default" => undef } ]
}, },
{'temptreefile' => undef }, # tree file goes here {'temptreefile' => undef }, # tree file goes here
{'Model Fit Results' => [ '/dev/null'] }, # this will not work under Windows {'Model Fit Results' => [ $null] }, # Windows have NUL instead of /dev/null
{'dN/dS bias parameter' => [ { "Estimate dN/dS only" => undef }, {'dN/dS bias parameter' => [ { "Estimate dN/dS only" => undef },
{ "Neutral" => undef }, { "Neutral" => undef },
{ "Estimate" => undef }, { "Estimate" => undef },
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Phylo/LVB.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ sub _run {
chdir($self->tempdir); chdir($self->tempdir);
#open a pipe to run lvb to bypass interactive menus #open a pipe to run lvb to bypass interactive menus
if ($self->quiet() || $self->verbose() < 0) { if ($self->quiet() || $self->verbose() < 0) {
open(LVB_PIPE,"|".$self->executable.">/dev/null"); my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
open(LVB_PIPE,"|".$self->executable.">$null");
} }
else { else {
open(LVB_PIPE,"|".$self->executable); open(LVB_PIPE,"|".$self->executable);
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Phylo/Phylip/Consense.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ sub _run {
chdir($self->tempdir); chdir($self->tempdir);
# open a pipe to run Consense to bypass interactive menus # open a pipe to run Consense to bypass interactive menus
if ($self->quiet() || $self->verbose() < 0) { if ($self->quiet() || $self->verbose() < 0) {
open(Consense,"| ".$self->executable .">/dev/null"); my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
open(Consense,"| ".$self->executable .">$null");
} }
else { else {
open(Consense,"| ".$self->executable); open(Consense,"| ".$self->executable);
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Phylo/Phylip/DrawGram.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ sub _run {
$self->debug( "Program ".$self->executable." $param_string\n"); $self->debug( "Program ".$self->executable." $param_string\n");
# open a pipe to run drawgram to bypass interactive menus # open a pipe to run drawgram to bypass interactive menus
if ($self->quiet() || $self->verbose() < 0) { if ($self->quiet() || $self->verbose() < 0) {
open(DRAW,"|".$self->executable.">/dev/null"); my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
open(DRAW,"|".$self->executable.">$null");
} }
else { else {
open(DRAW,"|".$self->executable); open(DRAW,"|".$self->executable);
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Phylo/Phylip/DrawTree.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ sub _run {
$self->debug( "Program ".$self->executable." $param_string\n"); $self->debug( "Program ".$self->executable." $param_string\n");
# open a pipe to run drawgram to bypass interactive menus # open a pipe to run drawgram to bypass interactive menus
if ($self->quiet() || $self->verbose() < 0) { if ($self->quiet() || $self->verbose() < 0) {
open(DRAW,"|".$self->executable.">/dev/null"); my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
open(DRAW,"|".$self->executable.">$null");
} }
else { else {
open(DRAW,"|".$self->executable); open(DRAW,"|".$self->executable);
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Phylo/Phylip/Neighbor.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ sub _run {
chdir($self->tempdir); chdir($self->tempdir);
#open a pipe to run neighbor to bypass interactive menus #open a pipe to run neighbor to bypass interactive menus
if ($self->quiet() || $self->verbose() < 0) { if ($self->quiet() || $self->verbose() < 0) {
open(NEIGHBOR,"|".$self->executable.">/dev/null"); my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
open(NEIGHBOR,"|".$self->executable.">$null");
} }
else { else {
open(NEIGHBOR,"|".$self->executable); open(NEIGHBOR,"|".$self->executable);
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Phylo/Phylip/ProtDist.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ sub _run {
chdir($self->tempdir); chdir($self->tempdir);
#open a pipe to run protdist to bypass interactive menus #open a pipe to run protdist to bypass interactive menus
if ($self->quiet() || $self->verbose() < 0) { if ($self->quiet() || $self->verbose() < 0) {
open(PROTDIST,"|".$self->executable .">/dev/null"); my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
open(PROTDIST,"|".$self->executable .">$null");
} }
else { else {
open(PROTDIST,"|".$self->executable); open(PROTDIST,"|".$self->executable);
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Tools/Run/Phylo/Phylip/ProtPars.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -355,7 +355,8 @@ sub _run {
chdir($self->tempdir); chdir($self->tempdir);
#open a pipe to run protpars to bypass interactive menus #open a pipe to run protpars to bypass interactive menus
if ($self->quiet() || $self->verbose() < 0) { if ($self->quiet() || $self->verbose() < 0) {
open(PROTPARS,"|".$self->executable.">/dev/null"); my $null = ($^O =~ m/mswin/i) ? 'NUL' : '/dev/null';
open(PROTPARS,"|".$self->executable.">$null");
} }
else { else {
open(PROTPARS,"|".$self->executable); open(PROTPARS,"|".$self->executable);
Expand Down
Loading

0 comments on commit 52ec7b5

Please sign in to comment.