2.11BSD/sys/pdpstand/OLD/bcopy.c

Compare this file to the similar file:
Show the results in this format:

/*
 * Copyright (c) 1986 Regents of the University of California.
 * All rights reserved.  The Berkeley software License Agreement
 * specifies the terms and conditions for redistribution.
 *
 *	@(#)bcopy.c	1.1 (2.10BSD Berkeley) 7/25/87
 */

#define BLKSIZE 1024
char module[] = "bcopy";		/* module name -- used by trap */
char buffer[BLKSIZE];
main()
{
	int c, o, i;
	char buf[50];

	printf("%s\n",module);
	do {
		printf("Infile: ");
		gets(buf);
		i = open(buf, 0);
	} while (i <= 0);
	do {
		printf("Outfile: ");
		gets(buf);
		o = open(buf, 1);
	} while (o <= 0);

	if ((c = read(i, buffer, BLKSIZE)) > 0)
		write(o, buffer, c > 512 ? 512 : c);
	exit(0);
}