#include <stdio.h>
#define NAME "concat"
#define VERSION "2.0"

main(int argc,char *argv[])
{
	FILE *fi,*fo;
	int c;

	if (argc<3){
	printf("By Andrew Gaunt, AKA Quantum, #1@6300 - May be freely shared.\n\n");
	printf("usage: concat file1 file2\n\n");
	printf("Concat will append the contents of file1 to file2.\n");
	printf("\n[%s v%s]\n",NAME,VERSION);

	exit(0);
	}

	if ( (fi=fopen(argv[1],"r")) == NULL){
		printf("Can't read %s\n",argv[1]);
		exit(1);
	}

	if ( (fo=fopen(argv[2],"a")) == NULL){
		printf("Can't append to %s\n",argv[2]);
		exit(1);
	}

	while( (c=fgetc(fi)) != EOF){
		fputc(c,fo);
	}
	fclose(fi);
	fclose(fo);
}
