#include "stdio.h"		/* include file overhead info */

main(argc, argv)		/* General program head with two file args */
int argc;			/* If args are not supplied in program line */
char *argv[];			/* user is prompted for file names */
{
	FILE	*fp1, *fp2;
	char	*gets();
	char	arg1[14],arg2[14];	/* long enough for d:filename.ext */
	char	*pa;			/* pointer to arg in program line */
	char	*p1 = arg1;		/* pointer to where 1t arg is copied */
	char	*p2 = arg2;		/* pointer to where 2d arg is copied */

	if (argc < 2) {
		printf("Read from file: ");
		p1 = gets(p1);
		while (*p1 = toupper(*p1))
			p1++;
	}
	else {
		pa = argv[1];
		while (*p1++ = *pa++)
			;
	}
	p1 = arg1;
	if ((fp1 = fopen(p1, "r")) == NULL) {
		printf("Can't open read file %s\n", p1);
		exit(-1);
	}

	if (argc < 3) {
		printf("Write to file:  ");
		p2 = gets(p2);
		while (*p2 = toupper(*p2))
			p2++;
	}
	else {
		pa = argv[2];
		while (*p2++ = *pa++)
			;
	}
	p2 = arg2;
	if ((fp2 = fopen(p2, "w")) == NULL) {
		printf("Can't open write file %s\n", p2);
		exit(-1);
	}

	printf("\nWorking on file %s\n",p1);

/* ............. Program body .............. */


	fclose(fp1);
	fclose(fp2);
}
