/*
 Test file access functions
 */
#include <stdio.h>
#include <errno.h>

int main(int argc, char **argv){
	FILE *f1;
	FILE *f2;
	char buf[128];
	if (argc<=2) return -1;
	f1=fopen(argv[1],"r");
	if(f1==0) {
		perror(argv[1]);
		return -1;
	}
	f2=fopen(argv[2],"w");
	if(f2==0) {
		perror(argv[2]);
		return -1;
	}
	while(1) {
		int out=fscanf(f1,"%s",buf);	
		if (out<=0){
			 perror("END");
			 break;
		}
		fprintf(f2,"%d: %s\n", out, buf);
	}
	fclose(f1);
	fclose(f2);
	return 0;
}
