static char sccsid
[] = "@(#)arcv.c 4.1 %G%";
* arcv - convert old to new archive format
if (argc
>1 && strcmp(argv
[1], "-t")==0) {
tmp
= mktemp("/usr/tmp/arcXXXXXX");
tmp
= mktemp("/tmp/arcXXXXXX");
printf("%s:\n", argv
[i
]);
printf("arcv: cannot open %s\n", fil
);
printf("arcv: cannot open temp\n");
read(f
, (char *)&oldmagic
, sizeof(oldmagic
));
if(oldmagic
!= 0177545) {
printf("arcv: %s not old archive format\n", fil
);
chkwrite(tf
, ARMAG
, SARMAG
);
i
= read(f
, (char *)&oh
, sizeof(oh
));
sprintf(buf
, "%-16.14s%-12ld%-6u%-6u%-8o%-10ld%-2s",
(unsigned short)oh
.oar_mode
,
strncpy((char *)&nh
, buf
, sizeof(nh
));
chkwrite(tf
, (char *)&nh
, sizeof(nh
));
read(f
, buf
, i
&01? i
+1:i
);
while((i
=read(tf
, buf
, 512)) > 0)
if (write(f
, b
, n
) != n
) {
printf("arcv: write error\n");