* Copyright (c) 1985 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
"@(#) Copyright (c) 1985 Regents of the University of California.\n\
static char sccsid
[] = "@(#)tcopy.c 5.3 (Berkeley) %G%";
register n
, nw
, inp
, outp
;
if (argc
<=1 || argc
> 3) {
fprintf(stderr
, "Usage: tcopy src [dest]\n");
if ((inp
=open(inf
, O_RDONLY
, 0666)) < 0) {
fprintf(stderr
,"Can't open %s\n", inf
);
if ((outp
=open(outf
, O_WRONLY
, 0666)) < 0) {
fprintf(stderr
,"Can't open %s\n", outf
);
if (signal(SIGINT
, SIG_IGN
) != SIG_IGN
)
(void) signal(SIGINT
, RUBOUT
);
n
= read(inp
, buff
, SIZE
);
nw
= write(outp
, buff
, n
);
fprintf(stderr
, "write (%d) != read (%d)\n",
fprintf(stderr
, "COPY Aborted\n");
printf("file %d: records %ld to %ld: size %d\n",
filen
, lcount
, count
-1, ln
);
printf("file %d: record %ld: size %d\n",
if (ln
<= 0 && ln
!= -2) {
printf("file %d: records %ld to %ld: size %d\n",
filen
, lcount
, count
-1, ln
);
printf("file %d: record %ld: size %d\n",
printf("file %d: eof after %ld records: %ld bytes\n",
op
.mt_count
= (daddr_t
)1;
if(ioctl(outp
, MTIOCTOP
, (char *)&op
) < 0) {
if (nfile
&& filen
> nfile
)
printf("total length: %ld bytes\n", tsize
);
printf("file %d: records %ld to %ld: size %d\n",
filen
, lcount
, count
, ln
);
printf("file %d: record %ld: size %d\n",
printf("rubout at file %d: record %ld\n", filen
, count
);
printf("total length: %ld bytes\n", tsize
+size
);