fdf40ab1b8271323c7bf3a8d71d8701918cef1fa
* Copyright (c) 1993 The Regents of the University of California.
* %sccs.include.redist.c%
"@(#) Copyright (c) 1993 The Regents of the University of California.\n\
static char sccsid
[] = "@(#)copy.c 7.1 (Berkeley) %G%";
* Copy from from to to. Intended for use in system installation.
register int from
, to
, record
, rcc
, wcc
, bsize
= BSIZE
;
from
= getfile("From", 0);
for (record
= 0;; ++record
) {
if (!(rcc
= read(from
, buf
, bsize
)))
printf("Record %d: read error, errno=%d\n",
printf("Block size set from input; %d bytes\n",
printf("Record %d: read short; expected %d, got %d\n",
/* For bug in ht driver. */
if ((wcc
= write(to
, buf
, rcc
)) < 0) {
printf("Record %d: write error: errno=%d\n",
printf("Record %d: write short; expected %d, got %d\n",
printf("copy completed: %d records copied\n", record
);