-+-+-+-+-+-+-+-+ START OF PART 2 -+-+-+-+-+-+-+-+ V\9C06\290Alb\4510\6911pmd`20\2408post`20mortem`20dump\260Ast\4A0Atask`20symbol V`20\DA0Fsys`20\2708boot\1E05sys\5104\2509tsk`20\2508execut\2705\5705\2506PP X.TP`208 X.B`20f XUse`20the`20next`20argument`20in`20\1504command`20line`20as`20\1404tape`20devi Vce`20to Xbe`20used,`20rather`20than\2805default. X.sp XIf`20vmsbackup`20is\5904piled`20with\2F05remote\5E06option Xand`20\1B04file`20name`20ha\8406form X.IR\FE08`5B.\8504r`20`5D:/dev/??? X.I\720A Xwill`20use\C10Brive`20/\2E07`20o\B406\8507\5606\610C, Xvia X\1104rsh`20(1), Xand\1106mt`20(8). XTh\BA08al\7F04user Xportion`20of`20\6104path\CA05specifie\D006login`20\1905to\A905\9106 Xr\910C. XIf`20it`20is`20not`20supplied,\4305current`20user's\520C\FD05be\1A04d. XIn`20all`20\3305ases\3E06user`20must`20have\1305appropriate Xpermissions`20\9A06`20r\9A06machine,`20in`20order`20\C107this`20facility. XThe`20defaul\C004 X.I`20/dev/rmt8 X(drive`200,`20raw`20mode,`201600`20bpi). XThis`20\9C05be`20a`20\2408`20tap\5404vice. X.TP`208 X.B`20s`20saveset XProces\B104ly\B305given`20\1F07`20number.\3A0At XProduce\6503table`20of`20contents`20(a`20directory`20listing)`20on\5A05standar Vd`20output Xof`20\1704file\8004\AB05\6A0Bv XVerbose`20output. XNormally X.I`20vmsbackup`20 Xdoes`20its`20work`20silently. XThe`20ve\4307ption`20will`20cause`20\7B08names`20o\8C0Cbeing`20read`20from Xtape`20to`20disk\0804be\9307\DA17\C50Bw X\AC0C Xprints`20\3404ac\9205\4F06taken`20followed`20by`20file`20name,`20then Xwait`20for`20user`20confirmation.`20If`20a\FD04d`20beginning`20with`20`60y' Xis`20given,\760Cis`20done.`20Any`20other`20in\D104mean\1C05't`20do`20i\CC0Cx Xextract\4A05named`20files`20from\1505tape\3208The`20optional`20 X.I\3205 Xargument`20specifies`20one`20or`20more\5005names`20to`20be Xsearched`20for`20\3307cally`20on`20\7208`20and`20only`20thos\4506s`20are`20t V\4504`20processed. X\9504name`20may`20contain\4805usal`20sh(1)`20meta-characters`20*?!`5B`5D`20 V`5Cnnn. X.SH`20FILES X/dev/rmt`5CfIx`5CfP\1A05SEE`20ALSO Xrmtops(3)\1705BUGS\7A05\DE08`20match`20us\E804he`20complete`20VMS\2505\A405s. X X\3F04AUTHOR XJohn`20Douglas`20Carey X.br XSven-Ove`20Westberg $ call unpack [.VMS-BACKUP]VMSBACKUP.1;1 - 1333114504 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" $! $ create 'f' X/* X`20* X`20*`20`20Title: X`20*`09Backup X\1807Decription\1D05Program`20to`20read`20VMS`20backup`20tape X\3607Author\3205John`20Douglas`20CAREY. X\1703Sven-Ove`20Westberg`20`20`20`20(version`203.0) X\4C07Net-addess\5005john%monu1.oz@seismo.ARPA X\1D03luthcad!sow@enea.UUCP X\4907History:\2904Ve\69061.0`20-`20September`201984 X\2003`09Can`20only`20\E705variable`20length`20records X\4A0D1 X\3905leaned`20up`20the`20program`20from\1105original`20hack X\6B08now`20\6A05stream`20files\5F0E2 X\2D04Now`20convert`20filename\5D06VMS`20to`20UNIX X\2A04`09and`20creates`20sub-directori\5A103 X\3004Works`20on`20\A604Pyramid`20if`20SWAP`20is`20defined\3B0E4 X\3B04Reads`20files`20spanning`20multiple`20tape`20blocks\3D0E5 X\3D04Always`20reset`20reclen`20=`200\8A04file`20open X\FB08output`20fixed`20length`20records X`20* X`20*`20`20`20`20`20`20\64082.0`20-`20July`20198\7006VMS`20\20084.0`20caus V\B803a`20rethink`20!!\6F09use`20mtio`20operations`20instead`20of`20open\EB04an Vd`20clos\0C04file\4005Blocksize`20now`20grabed`20from`20the`20label X\B305`09V\AE091`20-`20September`20\B309Handle`20variable`20l\F90D\8A04zero V\1707. X\56102`20-`20July\51046 X\510BFORTRAN`20\491A`09`09Inserted`20exit(0)`20at`20end`20of`20program.\2805Di Vstribu\2B04\1907`20in`20aus.sources X\98103`20-`20August\9A21wi\F009\FE08fields\3505at`20the`20\9707a`20block X\1A04Put`20debug`20output`20to\2003file\B61Dnet.\B6163.0`20-`20December\B811mu Vltiple`20saveset`20\1D05Remote`20tape X\1004Interactive`20mod\1506File`20name`20selection`20\F705meta-characters V\2D05Convert`20;`20to`20:`20in`20VMS`20filename\2406Flag`20for`20usage`20of V`20\2404directory`20structure\2E0E"useless"`20files`20`20eg.`20*.exe\5610e`20 V\5104version`20in`20file\C305\810Fverbose`20\EC0A\1A04to`20list`20the`20conten Vts`20of`20\1004tape\2A05Distributed\3104mod.sourc\6305 X`20* X`20*`20`20Installation: X\1505`09Computer`20Cent\E406Monash`20University\1504Wellington`20Road\3B05layt Von\0B04Victoria`093168 X\1103AUSTRALIA X\6705/ X#include`09\130Bctype.h> X\270Cys/ioctl\2B0Esys/types.h> X#ifdef`20REMOTE X\250Alocal/rmt.\3C11stat.h> X#endif X\1D0Emt\9A10sys/file\9D07\6F05pyr X#define`20SWAP\4C07\1805\2408sun X\2413 X Xstruct`20bbh`20`7B X`09short`09bbh_dol_w_size;\1712opsys\1813subs\1915applic; X`09long\1809l_number; X`09char\1809t_spare_1`5B20`5D;\6713truclev;\1B12volnum\6912cr\7E13blocks\E306 V\1B0Fflag\C904\9810sname`5B32\9714fid`5B3`5D\1913di\1907\4E0Ffile\5005128`5D V\1F10b_rtyp\9B04\1710attrib\6813rs\CC06\310Fbkts\1915vfcs\1906\4A10maxrec; X`09long\1809l_file\4C14t_spare_2`5B22\CA04\5010checksum; X`7D`20*block_header; X Xstruct`20brh`20`7B\3A09rh\D40F\1811type\A109\1707l_flags\1712addres\1913spare V\9605record_\9709/*`20define`20\1A06`20types`20*/ X X#define\4709k_null`090\1913summary`091\1C13volume`092\1B13file`093\3414bn`094 V\1808`20b\1809physvol`095\1C13lbn`096 X\6514d`097 X Xstruct`20bsa`20`7B X`09short`09bsa_dol_w_size; X\1711type; X`09char\1609t_text`5B1`5D; X`7D`20*data_item; X X#ifdef`09STREAM X\3505*def_tapefile`20=`20"/dev/rts8"; X#else X\281Cmt\2806ndif\2907\2508; X X\1105filename`5B128`5D; Xint`09file\D106\2306recfmt;`09`09/*`20record`20format`20*/ X X#define`09`09`09FAB_dol_C_UDF`090`09/*`20un\1E06d`20*/ X\2A14FIX`091`09/*`20fixed-length`20\6607\3417VAR`092`09/*`20variable\3727FC V`093\3714with`20\800Dcontrol`20\5111`20`09\510BSTM`094`09/*`20RMS-11`20stream V`20\3507(valid`20only`20for`20sequential`20org)`20\A617STMLF`095\5704\500Edeli Vmited`20by`20LF`20(s\510D\6905\560C\AB10CR`096\561FCR\5621\AC0DMAXRFM\5706maxi Vmum`20rfm`20supported`20*/ X Xchar`09recatt;`09`09/*`20\7B07attributes`20*/ X X\6112V_FTN`090`09/*`20FORTRAN`20carriage`20control`20character`20\A415V_CR`091 V`09/*`20line`20feed`20-`20\8107-c\4E08return\4318PRN`092`09/*`20print-file V\8912\3C17BLK`093`09\F509s`20don't`20cross`20block`20boundaries\4504\4609FANO V`0920 X X#ifdef`09pyr Xstatic`20struct`09bsa`09*file_table`5BFANO`5D; X#else Xst\241Endif X XFILE`09*f`09=`20NULL; Xint`09file_count; Xshort`09reclen;\0E07fix;\190Asize\3806vf\0D07\B208NEWD\6207lf\7408\1606\6906d; V`09`09/*`20tape`20file`20descriptor`20*/ Xint`20`09cflag,`20d\0706ef\0705sf\0705tf\0705vf\0705wf\0705xflag\9206setnr; Xchar`09**gargv;\5606goptind,`20gargc; X X#define`09LABEL_SIZE`0980 X\3A05label`5B\190A`5D; X X\5306block;\6B05block\FF07struct`09mtop`09op; X XFILE`20* Xopenfile(fn)\4207fn; X`7B X`09c\0D04ufn`5B256`5D; X\1006ans`5B80\0F09*p,`20*q,`20s,`20*ext; X`09\7804procf; X X\0906`20=`201; X`09/*`20copy`20fn`20to`20ufn`20and`20convert`20to`20lower`20case`20*/ X`09p\3803fn; X`09q\0903ufn; X`09while`20(*p)`20\A003`09if`20(isupper(*p)) X`09`09`09*\2E04*p`20-`20'A'`20+`20'a'; X`09`09else X\1F0A\1304p++;\0703q+\0704`7D X\1B06'`5C0'\B904\AD05\9A07he`20VMS\A204UNIX\B605make\1905directory`20path V\B809\AF06\5104++\6D04\B908q)\B909\6F04=`20'.'`20`7C`7C`20\0D07`5D'\2006`09s V\A604q;\B209\9706\0E03if(procf`20`26`26`20dflag)`20mkdir(p,`200777);\340A/' V\3307`20(s`20=\5F06\1104`09break\1C04\F603`09*q++; X`09\0B03\0A07if(!d\5B06p=\8404/*`20strip`20off\F505version`20number\F505\E109 V\9904*q`20!=`20';'\EE08(`20\EE09)`20ext`20=`20\DD05\7B09\A404cf\7405\3204 V\C006:'\1D06else\170B`5C0\1807if(!eflag\7404procf)\0706\2603typecmp(++ext); V\2D05\1C06\2C03wf\6A09printf("extract`20%s`20`5Bny`5D",filename\3C04`09fflush( Vstdout\1205gets(ans\0D05if(*ans\F505y'\850ANULL\AB09\A106\2E03/*`20open`20the V`20file`20for`20writing`20*/ X`09`09return(fopen(p,`20"w")\6904else\1F0ANULL); X`7D X Xt\ED07str)`20`20`20`20/*`20Compare`20\6508name`20type`20in`20str`20with`20our V`20list X`20\3704\0505\0909of\9E06\3505to`20be`20ignored.`20`20Return`200`20if`20the V\4014\3D05is\3B0E,`20\BD06`201\3A23not`20in`20\A508`20and`20should`20\1B04 V\910C*/ Xregister`20char`20`20`20*str; X`7B X\5608static\1E06*type`5B`5D`20=`20`7B\8111"exe",\100A/*`20vms`20executabl V\7603mage\7304\3B11lib"\3B12object`20library`20\3914obj\390Frsx`20\3907fi V\7503\3615dl\3614verlay`20description\431Blb\791A\B21Cpmd"\3912post`20mortem V`20dump\3B15st\7414symbol`20tab\AB17sys"\3712boot\3305sys\7604imag\4016tsk" V\4012execut\4205\3B09`09`09"dir",\0904upd",\0904tlo"\0907b",\5F12"`20\100D V\5F03null`20string`20terminates`20list`20\A10B`7D;\0B09register`20int`20\1003i V; X X\1C08i`20=`20-1\2C0Awhile`20(*type`5B++i`5D)\9411if`20(strncmp(str,`20\2C05i V`5D,3)`20==`200\3212\890Aturn(0);\CE09found`20a`20match,`20f\7E04to`20be`20ign Vored`20\D40B\40071)\4007\6010/*`20no\4B06\5907*/ X`7D X Xprocess_file(buffer) Xchar`09*buffer; X`7B X`09int`09i,`20n; X`09\1C06p,`20*q; X`09short`09dsize,`20nblk,`20lnch; X X\3405c;\2308*s\1407`20`09procf; X X`09s`20=`20(short`20*)`20\6F08 X`09/*`20check`20the`20header`20wor\B305`09if`20(*s`20!=`20257)`20\9D03`09print Vf("Snark:`20invalid`20data\3F07`5Cn"); X`09`09exit(1); X`09`7D X X`09c\80032; X`09for`20(i\0D030;`20i`20<`20FANO;`20i++\5F06file_table`5Bi`5D`20\B304truct V`20bsa`20*)`20`26buffer`5Bc`5D; X#ifndef`09SWAP X`09`09dsize`20=`20\420D->bsa_dol_w_size; X#else\2F03swap(`26\2D1D,`20`26d\0806sizeof(short)); X#endif\4603c`20+=`20d\7A05+`204;\EB06/*`20extract`20file`20name`20*/\B10F V\B0130`5D\B019\AF11\2C12\AF22p`20\6F19t_text; X`09q`20\2406name; X`09for`20(i\14030;`20i`20<\EC06;`20i++) X`09`09*q++\1C03*p++; X`09*q\0C03'`5C0'; X X`09/*`20extract\4F05's`20record`20attributes`20*/ X#ifndef`09SWAP X`09dsize\A50E5`5D\E810; X#else X`09swap(`26f\2C1C,`20`26d\0806sizeof(short)); X#endif X`09p`20\6F19t_text; X`09recfmt`20=`20p`5B0`5D\1006att\10051`5D; X#\C40Dbcopy(`26p`5B2`5D,`20`26rec\8018\C40B\2D22\AD06vfcsize\7A065`5D; X`09if`20(\1609=`200) X`09\260B2; X#if\9C04DEBUG X`09printf("r\D208%d`5Cn",`20recfmt); X\220C\E406\220Aatt\220Flen`20\220Csize\230C\8A0A\2407\1107\D30A#ifndef`09SWAP X`09bcopy(`26p`5B10`5D,`20`26nblk,`20sizeof(short)); X`09\260A2`5D\2603lnch\2612#else X`09swap(\5120\2509\501Dndif X`09files\D406(nblk-1)*512`20+`20lnch; X#ifdef`20DEBUG X`09printf("nbk`20=`20%d,`20lnch\0B05`5Cn",`20n\9105lnch\8804\2E08\640B0x%x V\2A05\1408\8B0A X`09/*`20open`20the`20file`20*/ X`09if`20(f`20!=`20NULL)`20`7B X`09`09fclose(f\6404\C105_count\5F04\1204reclen`20\0E06`7D X`09procf`20\0F06\4E04goptind`20<`20gargc)`20 X\4603or(i=g\1A06;`20i`20\1D07;`20i++\7606\4807`7C=`20match(filename,gargv`5Bi V`5D\8F05\7003else\0A03\77081;\7706tflag`20`26`26`20procf\7605printf(`20"`20%-3 V5s`20%8d`20`5Cn",\5B09filesize\5B04\4404xf\440E\9804/*`20open`20file`20*/ X\CD03\7603openfile\A709\9E05if(f`20!=`20NULL\4704vflag)`20\8807"extracting`20% Vs\8904\5505\3E08`7D X`7D X/* X`20* X`20*`20\8205ess`20a`20virtual`20block`20record`20(\8F05\0D06) X\3405/ X\3407_vbn(buffer,`20rsize) Xchar`09`09*\1606; Xunsigned`20short`09rsize; X\EF03int`09c,`20i; X X`09if`20(f`20=\CF06)`20\1E03`09return;\AD04`09i`20=`200; X`09wh\8B04(file_count+i`20<\DA05size`20`26`26`20\1004\8806\4505switch`20(recfm Vt)\1405case`20FAB_dol_C_FIX: X`09`09\8305reclen`20==`200)\2C05\8704\1306`20rec\BB06\1503\9303`09`09fputc( V\E706`5Bi`5D,`20f);\4905++\0805\3A06--\0D05break; X X`09\7F10VAR:\1613FC\9525*((short`20*)`20`26b\8B08); X#ifdef`09SWAP X\3204swap(`26\3806,`20\0909sizeof\4406)); X#endif X\3E07NEWD\3E05fprintf(lf,`20"---`5Cn")\D705\1A0E\9709%d`5Cn",`20\1006\2A14i V`20\2509i)\4A14size\490Bsize\9F09\980Bix\2503\6706\4606i`20+=`202\0C07f`20(rec Vfmt`20==`20FAB_dol_C_VFC)`20`7B X\2304\3006vfcsize\3606`09r\C606-=\180E`7D X\0504`20else`20\5A07\ED05=`20fix\3A06`26`26\8C04at\7005(1`20<<`20\7608V_FTN) V\7709/**** X\8206f`20(buffer`5Bi`5D`20==`20'0')\1B06`09fputc('`5Cn',`20f);\1606\8209\360E1 V'\3610f'\360B***`20sow`20***/ X\270B\4509,f);`20/\2609\2507i++;\0A06\F006--\0F05`7D`20\8605\CE06\4910\7509 V\3D09\3C0E\0504\C004\1606\BD040)\4B0D\F10E\2B04i`20`26`201)\930E\4805break; X X`09`09case`20FAB_dol_C_STM:\1615LF\1804\810C<`20\8009printf("SCREAM`5Cn") V\B321\1308`20512\2D0Ac`20=`20buffer`5Bi++`5D;\1404\2A06--\0D05\4E04c`20==`20 V\ED04\4C110;\4A09fputc(c,`20f\8C06\F21CCR\DC05\7D14\700Br') X\6E04\5A06\8004\5D09else\1C0B\7614default:\9C05close(\2407unlink(filename) V\1505fprintf(stderr,`20"Invalid`20record`20format\B103%d`5Cn",\1704fmt)\3C05re Vturn\0B04`7D X\0303`09file_count`20+=`20i; X`7D X#ifdef`09SWAP X/* X`20* X`20*`20`20do`20swapping\6104`20Motorola`20type`20architectures\3306/ Xswap(from,`20to,`20nbytes) Xchar`09*f\1805*to; Xint`09nbytes; X`7B X`09int`09i,`20j; X`09\2B05temp`5B100`5D; X X`09for`20(i\DC030;`20i`20<\5507;`20i++) X`09`09\2C05i`5D\2003from\0A03; X`09\330A,`20j\0703\3306-1\4111,`20j--\4605o`5B\4405\4E05j`5D; X`7D X#endif X/\DA04 X`20*`20`20process`20a`20backup`20block\FB08\1E07_block(block,`20blocksize) X\D905*block; X\F104\1C09; X`7B X X`09unsigned`20short`09bhsize,`20rs\0706type; X`09\2609long`09b\1D06i; X X`09\EF05\0904/*`20read`20the`20\A90C`20header\AC04\7C06_h\1106=`20(struct`20bb Vh`20*)`20`26block`5Bi`5D;\5704+=`20sizeof\260B); X X`09\A306\3F03\4E0C->bbh_dol_w_size; X\A606\2719l_block\2C06#ifdef`09SWAP X`09swap(`26bhsize,`20\0909\8D08hort)); X`09\2807\2708\260Dlong)); X#endif X X`09/*`20check`20the`20validity`20of\1005\9C06\A906`20*/ X`09if`20(b\E706!=\7A09truct`20bbh))`20`7B X`09`09fprintf(stderr,`20"Snark:`20Invalid\570Esize`5Cn"); X`09`09exit(1); X`09`7D X\6C06\6B080`20`26`26`20b\0E08blocksize\7026\691E#ifdef`09DEBUG X`09\4B07"new\3806:`20i`20=`20%d,`20\7F06\0C04`5Cn",`20i,\1206); X#endif X X`09/*`20read`20the`20records`20*/ X`09while`20(i`20<\3407\B805\2E0Cbackup\3507`20header\3B05`09record_h\1306=`20( Vstruct`20brh`20*)`20`26block`5Bi`5D;\2C03i`20+=\E905of\270B); X\4804type\4003\500D->brh_dol_w_rtype\4604rs\E906\2A1Asize; X#ifdef`09SWAP\3603swap(`26rtype,`20\0808\8C08hort))\5D04\2707size\2704\0806 V\2710#endif\6108DEBUG X`09`09printf("\CA08%d`5Cn",`20rtype\5C05\2109\C107\2108size\210Dflags`20=`200x V%x\2306\EB16l_flags\3C0Daddr\3B25addres\3D0Ei`20\9609i)\E809\2103switch`20( V\CD06`20`7B\1404case`20b\5007k_null: X#ifdef`09DEBUG\2403\F40Atype\5E03null`5Cn"\5D0A\2403break;\5313summary:\5621 V\2907\5929file\5622file\5310process_file(`26block`5Bi`5D); X\6F1Cvbn:\6E21vbn\6D18vbn\6C0A,`20rsize)\731Ephysvol:\7721\2907\7B10\5919lb V\CC23lbn\5129fid:\5121fid\511Adefault: X\1603fp\3A06stderr,`20"`20Snark:`20invalid`20record`20type\5206\3515\260B V\7E03%d`5Cn",`20rtype\3206exit(1\0C05`7D X\BD06`20pyr\0F03i`20=`20i`20+`20rsize; X#else X\1704+=\140A\C406`7D X`7D X Xrdhead() X`7B X`09int`20i,`20nfound; +-+-+-+-+-+-+-+- END OF PART 2 +-+-+-+-+-+-+-+-