https://github.com/jsollari/popABC
Tip revision: e6a0334445b5755bb52a0d2209120ee4e251e7b4 authored by Joao Sollari Lopes on 13 November 2017, 18:32:56 UTC
First commit
First commit
Tip revision: e6a0334
pop_joindata.c
/*
@author: joao lopes
@workplace: Reading University
@date: 13th November 2008
*/
#include "interface.h"
int joindata(int ninp, char *linp[],char *outp){
int i; //iterator
char c1;
FILE *out, //pntr to the output file
*in; //pntr to the output files
out = fopen(outp,"w");
if(out == NULL)
return 1; //can't create output file
printf("\n");
for(i=0 ; i<ninp ; i++){
in = fopen(linp[i],"r");
printf(">copying %s\n",linp[i]);
if(in == NULL)
return 2; //error::no input file
while(1){
c1=getc(in);
//STOP condition
if(c1 == EOF)
break;
putc(c1,out);
}
close(in);
}
//close file
fclose(out);
return 0;
} //end of main