Commit 0aa7d0c8 by Eric Coissac

Supress interactive log during thindexing if the stderr is redirectied

to a file
parent 5905d791
......@@ -10,6 +10,9 @@
#include "debug.h"
#include <unistd.h>
#include <stdio.h>
#define SETSORTED(x) ((x) | 0x80000000)
#define CLEARSORTED(x) ((x) & 0x7FFFFFFF)
#define GETSORTED(x) ((x) & 0x80000000)
......@@ -52,7 +55,8 @@ void partialCompSortBuffer(buffer_t *buffer,
if (shift==shiftmax && start > nextprint)
{
fprintf(stderr,"%9d sequences sorted\r",start);
if (isatty(fileno(stderr)))
fprintf(stderr,"%9d sequences sorted\r",start);
nextprint=start;
}
......@@ -300,7 +304,8 @@ void sortCompSuffix(buffer_t *buffer,uint32_t pos)
if (i > nextprint)
{
fprintf(stderr,"%9d suffixes sorted\r",nextprint);
if (isatty(fileno(stderr)))
fprintf(stderr,"%9d suffixes sorted\r",nextprint);
nextprint+=DISPLAYSTEP;
}
......
......@@ -10,6 +10,8 @@
#include <string.h>
#include "orgasm.h"
#include <unistd.h>
#include "debug.h"
......@@ -246,7 +248,8 @@ buffer_t * loadPairedFastq(FILE* forward,
{
if (seqbuffer->readCount > nextprint)
{
fprintf(stderr,"%9d sequences read\r",nextprint);
if (isatty(fileno(stderr)))
fprintf(stderr,"%9d sequences read\r",nextprint);
nextprint+=DISPLAYSTEP;
}
......
......@@ -7,6 +7,9 @@
#include "orgasm.h"
#include <unistd.h>
#include <stdio.h>
void loadSequences(buffer_t *buffer,FILE* input)
{
......
......@@ -6,6 +6,9 @@
*/
#include "orgasm.h"
#include <unistd.h>
#include <stdio.h>
void writeOrdoredSequences(buffer_t *buffer,FILE* output)
{
......@@ -20,7 +23,8 @@ void writeOrdoredSequences(buffer_t *buffer,FILE* output)
{
if (i > nextprint)
{
fprintf(stderr,"%9d sequences read\r",nextprint);
if (isatty(fileno(stderr)))
fprintf(stderr,"%9d sequences read\r",nextprint);
nextprint+=DISPLAYSTEP;
}
......
......@@ -10,6 +10,9 @@
#include "debug.h"
#include <unistd.h>
#include <stdio.h>
// We used the heavyiest bit of the order1 index to
// store the sorted status of a read
// these macro are setup to manipulate this bit
......@@ -104,7 +107,8 @@ void partialSortBuffer(buffer_t *buffer,
if (shift==1 && start > nextprint)
{
fprintf(stderr,"%9d sequences sorted\r",start);
if (isatty(fileno(stderr)))
fprintf(stderr,"%9d sequences sorted\r",start);
nextprint=start;
}
......@@ -401,7 +405,8 @@ void sortSuffix(buffer_t *buffer,uint32_t pos)
if (i > nextprint)
{
fprintf(stderr,"%9d suffixes sorted\r",nextprint);
if (isatty(fileno(stderr)))
fprintf(stderr,"%9d suffixes sorted\r",nextprint);
nextprint+=DISPLAYSTEP;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment