/* DREDGE ddu: nnnnnnn */ /* ddu: is a disk device. does a read logical NOT VIRTUAL block of block number nnnnnnnn outputs the block (8-bits-wide) to outfile nnn is long */ #define LUN 4 #define EFN 4 #define BLOCKSIZE 512 #include #include #include char buffer[BLOCKSIZE]; helpless() {puts("usage\tDREDGE\tddu: nnnnnnnn outfilespec"); puts("DEC RSX/VMS specific file (sc)raper."); puts("ddu: is device. nnnnnnnn is (decimal long) logical block number"); puts("outfilespec is file to copy block to."); exit(); } main(argc,argv) int argc; char **argv; { FILE *optr; int i; int dsw; int prl[6]; int isb[2]; int devnam; int devunt; long lbn; if (argc!=4) helpless(); if (argv[1][3]!=':') helpless(); if (!isdigit(argv[1][2])) helpless(); argv[1][0] = toupper(argv[1][0]); argv[1][1] = toupper(argv[1][1]); copy(&devnam,argv[1],2); devunt = argv[1][2] - '0'; dsw = alun(LUN,devnam,devunt); if (dsw!=IS_SUC) {error("Can't attach device! dsw=%oo devnam=%oo devunt=%oo",dsw,devnam,devunt); } ; sscanf(argv[2],"%ld",&lbn); prl[0] = buffer; prl[1] = BLOCKSIZE; prl[2] = 0; prl[3] = lbn>>16; prl[4] = lbn; prl[5] = 0; dsw = qiow(IO_RLB,LUN,EFN,isb,0,prl); if (dsw!=IS_SUC) error("dsw=%oo isb[0]=%oo isb[1]=%oo\n",dsw,isb[0],isb[1]); optr = fopen(argv[3],"wn"); if (!optr) error("Can't open output file \"%s\"\n",argv[3]); fput(buffer,BLOCKSIZE,optr); fclose(optr); }