Aucbvax.4284 fa.unix-wizards utzoo!decvax!ucbvax!unix-wizards Tue Oct 6 16:28:27 1981 Re: TOPS-10 Interchange Backup Tapes >From sdcarl!rusty@Berkeley Tue Oct 6 16:17:08 1981 This was written by Julius Smith last summer to read a DUMP format tape written on Stanford's Sail system. It is a quick-and-dirty but worked. # include # define NIN 512*5 # define NOUT 512*5 char mt[] = "/dev/nrmt0"; main(argc, argv) char **argv; { char t[NOUT],c[NIN]; register char *pt, *pc; register int fid; register int i, j; if ((fid = open(mt, 0)) == -1) { perror(mt); exit(1); } while (read(fid, &c[0], NIN) > 0) { for(j = 0; j < 512; j++) { pt = &t[5*j]; pc = &c[5*j]; # ifdef DEBUG for (i = 0; i < 5; i++) printf(" byte %d is %o\n", i, *(pc+i)); # endif DEBUG for (i = 0; i < 5; i++) { # ifdef DEBUG printf("byte %d is %o", i, *pc); # endif DEBUG *pt = (*pc >> (i+1)) & (0177 >> i); # ifdef DEBUG printf(" -> %o\n", *pt); # endif DEBUG *pt++ |= (*(pc++ -1) << (7-i)) & 0177; } *(pt-1) |= ((*(pc-1) >> 1) & 07); } *pt = '\n'; printf("%s", t); } }