
#include <stdio.h>

#define BUFSIZE 4096

int main ( int argc, char * argv [] ) {
	FILE * infile;
	FILE * outfile;
	int    charsread;
	char buf [BUFSIZE+1];

	if ( argc != 3 ) {
		printf ( "Usage %s: <infile> <outfile>\n",
			 argv [0] );
		return 1;
	}
	infile = fopen ( argv [1], "rb" );
	if ( infile == NULL ) {
		printf ( "File '%s' not found\n",
			 argv[1] );
		return 2;
	}
	outfile = fopen ( argv [2], "wb" );
	if ( outfile == NULL ) {
		printf ( "Cannot create ouput file '%s'\n",
			 argv [2] );
		fclose ( infile );
		return 3;
	}
	
	fread ( buf, 1, 13, infile );
	while ( !feof ( infile ) ) {
		charsread = fread ( buf, 1, BUFSIZE, infile );		
//		buf [charsread] = 0;
//		printf ( "%s\n", buf );
		fwrite ( buf, 1, charsread, outfile );
	};

	fclose ( infile );
	fclose ( outfile );
	return 0;
}

