1: /*
2: * Copyright (c) 1986 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)bcopy.c 1.1 (2.10BSD Berkeley) 7/25/87
7: */
8:
9: #define BLKSIZE 1024
10: char module[] = "bcopy"; /* module name -- used by trap */
11: char buffer[BLKSIZE];
12: main()
13: {
14: int c, o, i;
15: char buf[50];
16:
17: printf("%s\n",module);
18: do {
19: printf("Infile: ");
20: gets(buf);
21: i = open(buf, 0);
22: } while (i <= 0);
23: do {
24: printf("Outfile: ");
25: gets(buf);
26: o = open(buf, 1);
27: } while (o <= 0);
28:
29: if ((c = read(i, buffer, BLKSIZE)) > 0)
30: write(o, buffer, c > 512 ? 512 : c);
31: exit(0);
32: }
Defined functions
main
defined in line
12;
never used
Defined variables
Defined macros