home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1679 < prev    next >
SHell self-extracting ARchive  |  1990-12-28  |  10.7 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: SHell self-extracting ARchive (archive/shar).

You can browse this item here: 1679

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail text default
99% file C source text default
98% file C source, ASCII text default
100% TrID E-Mail message (Var. 2) default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/rfc822 default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 70 61 | 74 40 72 77 69 6e 67 2e |From: pa|t@rwing.|
|00000010| 55 55 43 50 20 28 50 61 | 74 20 4d 79 72 74 6f 29 |UUCP (Pa|t Myrto)|
|00000020| 0a 4e 65 77 73 67 72 6f | 75 70 73 3a 20 61 6c 74 |.Newsgro|ups: alt|
|00000030| 2e 73 6f 75 72 63 65 73 | 0a 53 75 62 6a 65 63 74 |.sources|.Subject|
|00000040| 3a 20 55 74 69 6c 20 74 | 6f 20 63 6f 6e 74 72 6f |: Util t|o contro|
|00000050| 6c 20 63 74 67 20 74 61 | 70 65 73 20 75 73 69 6e |l ctg ta|pes usin|
|00000060| 67 20 74 68 65 20 33 38 | 36 2e 69 78 20 57 61 6e |g the 38|6.ix Wan|
|00000070| 67 74 65 6b 20 64 72 69 | 76 65 72 0a 4d 65 73 73 |gtek dri|ver.Mess|
|00000080| 61 67 65 2d 49 44 3a 20 | 3c 31 32 39 40 72 77 69 |age-ID: |<129@rwi|
|00000090| 6e 67 2e 55 55 43 50 3e | 0a 44 61 74 65 3a 20 31 |ng.UUCP>|.Date: 1|
|000000a0| 36 20 41 75 67 20 39 30 | 20 30 32 3a 33 36 3a 30 |6 Aug 90| 02:36:0|
|000000b0| 30 20 47 4d 54 0a 0a 0a | 54 68 69 73 20 74 68 69 |0 GMT...|This thi|
|000000c0| 6e 67 20 69 73 20 66 6f | 72 20 74 68 6f 73 65 20 |ng is fo|r those |
|000000d0| 75 73 65 72 73 20 6f 66 | 20 49 53 43 20 33 38 36 |users of| ISC 386|
|000000e0| 2f 69 78 20 74 68 61 74 | 20 61 72 65 20 75 73 69 |/ix that| are usi|
|000000f0| 6e 67 20 74 68 65 20 57 | 61 6e 67 74 65 6b 0a 74 |ng the W|angtek.t|
|00000100| 61 70 65 20 64 72 69 76 | 65 72 2e 20 20 53 69 6e |ape driv|er. Sin|
|00000110| 63 65 20 74 68 65 20 74 | 61 70 65 63 6e 74 6c 20 |ce the t|apecntl |
|00000120| 6f 72 20 63 74 61 70 65 | 20 63 6f 6d 6d 61 6e 64 |or ctape| command|
|00000130| 73 20 64 6f 6e 27 74 20 | 77 6f 72 6b 20 77 69 74 |s don't |work wit|
|00000140| 68 20 74 68 69 73 0a 64 | 72 69 76 65 72 2c 20 6f |h this.d|river, o|
|00000150| 6e 65 20 69 73 20 6c 65 | 66 74 20 77 69 74 68 20 |ne is le|ft with |
|00000160| 6e 6f 20 6d 65 61 6e 73 | 20 74 6f 20 72 65 74 65 |no means| to rete|
|00000170| 6e 73 69 6f 6e 20 6f 72 | 20 65 72 61 73 65 20 74 |nsion or| erase t|
|00000180| 68 65 20 74 61 70 65 2e | 0a 57 74 2e 63 20 70 72 |he tape.|.Wt.c pr|
|00000190| 6f 76 69 64 65 73 20 61 | 20 6d 65 61 6e 73 20 74 |ovides a| means t|
|000001a0| 6f 20 61 63 63 6f 6d 70 | 6c 69 73 68 20 74 68 69 |o accomp|lish thi|
|000001b0| 73 2c 20 70 6c 75 73 20 | 70 72 6f 76 69 64 69 6e |s, plus |providin|
|000001c0| 67 20 61 20 72 65 77 69 | 6e 64 0a 61 6e 64 20 66 |g a rewi|nd.and f|
|000001d0| 73 66 20 28 66 77 64 20 | 73 6b 69 70 20 6f 76 65 |sf (fwd |skip ove|
|000001e0| 72 20 66 69 6c 65 29 20 | 66 75 6e 63 74 69 6f 6e |r file) |function|
|000001f0| 20 61 63 63 6f 6d 70 6c | 69 73 68 65 64 20 62 79 | accompl|ished by|
|00000200| 20 66 61 6b 69 6e 67 20 | 69 74 20 75 73 69 6e 67 | faking |it using|
|00000210| 0a 74 68 65 20 70 72 6f | 70 65 72 20 63 6f 6d 62 |.the pro|per comb|
|00000220| 69 6e 61 74 69 6f 6e 20 | 6f 66 20 6f 70 65 6e 28 |ination |of open(|
|00000230| 29 20 61 6e 64 20 63 6c | 6f 73 65 28 29 20 6f 6e |) and cl|ose() on|
|00000240| 20 74 68 65 20 74 61 70 | 65 20 64 65 76 69 63 65 | the tap|e device|
|00000250| 20 28 74 68 65 0a 6e 6f | 2d 72 65 77 69 6e 64 20 | (the.no|-rewind |
|00000260| 64 65 76 69 63 65 20 69 | 6e 20 74 68 65 20 63 61 |device i|n the ca|
|00000270| 73 65 20 6f 66 20 66 73 | 66 2c 20 74 68 65 20 72 |se of fs|f, the r|
|00000280| 65 77 69 6e 64 20 64 65 | 76 69 63 65 20 66 6f 72 |ewind de|vice for|
|00000290| 20 74 68 65 20 72 65 77 | 69 6e 64 0a 66 75 6e 63 | the rew|ind.func|
|000002a0| 74 69 6f 6e 29 2e 20 20 | 54 68 65 73 65 20 6f 70 |tion). |These op|
|000002b0| 65 6e 73 20 61 72 65 20 | 64 6f 6e 65 20 4f 5f 52 |ens are |done O_R|
|000002c0| 44 4f 4e 4c 59 20 73 6f | 20 61 73 20 74 6f 20 6e |DONLY so| as to n|
|000002d0| 6f 74 20 6d 61 72 6b 20 | 74 68 65 20 74 61 70 65 |ot mark |the tape|
|000002e0| 20 6f 72 0a 61 66 66 65 | 63 74 20 64 61 74 61 2e | or.affe|ct data.|
|000002f0| 20 20 49 74 20 77 6f 72 | 6b 73 20 66 6f 72 20 6d | It wor|ks for m|
|00000300| 65 2c 20 79 6f 75 72 20 | 6d 69 6c 65 61 67 65 20 |e, your |mileage |
|00000310| 6d 61 79 20 76 61 72 79 | 2e 20 20 49 74 20 63 6f |may vary|. It co|
|00000320| 6d 70 69 6c 65 73 20 4f | 4b 0a 6f 6e 20 49 53 43 |mpiles O|K.on ISC|
|00000330| 20 33 38 36 2f 69 78 2c | 20 49 20 64 6f 6e 27 74 | 386/ix,| I don't|
|00000340| 20 6b 6e 6f 77 20 61 62 | 6f 75 74 20 6f 74 68 65 | know ab|out othe|
|00000350| 72 20 66 6c 61 76 6f 72 | 73 2e 20 20 4e 6f 20 6d |r flavor|s. No m|
|00000360| 61 6b 65 66 69 6c 65 2c | 20 6a 75 73 74 0a 65 69 |akefile,| just.ei|
|00000370| 74 68 65 72 20 73 61 79 | 20 27 6d 61 6b 65 20 77 |ther say| 'make w|
|00000380| 74 27 20 6f 72 20 27 63 | 63 20 2d 4f 20 77 74 2e |t' or 'c|c -O wt.|
|00000390| 63 20 2d 6f 20 77 74 27 | 2e 0a 0a 54 68 65 20 70 |c -o wt'|...The p|
|000003a0| 6f 73 74 69 6e 67 20 77 | 61 73 20 69 6e 73 70 69 |osting w|as inspi|
|000003b0| 72 65 64 20 62 79 20 4d | 6f 73 74 20 46 72 65 71 |red by M|ost Freq|
|000003c0| 75 65 6e 74 6c 79 20 41 | 73 6b 65 64 20 51 75 65 |uently A|sked Que|
|000003d0| 73 74 69 6f 6e 20 23 35 | 20 69 6e 0a 74 68 65 20 |stion #5| in.the |
|000003e0| 63 6f 6d 70 2e 75 6e 69 | 78 2e 33 38 36 69 78 20 |comp.uni|x.386ix |
|000003f0| 6e 65 77 73 67 72 6f 75 | 70 2e 20 20 49 74 73 20 |newsgrou|p. Its |
|00000400| 70 6f 73 74 65 64 20 68 | 65 72 65 2c 20 62 65 63 |posted h|ere, bec|
|00000410| 61 75 73 65 20 63 6f 6d | 70 2e 75 6e 69 78 2e 33 |ause com|p.unix.3|
|00000420| 38 36 2f 69 78 0a 69 73 | 6e 27 74 20 61 20 73 6f |86/ix.is|n't a so|
|00000430| 75 72 63 65 73 20 6e 65 | 77 73 67 72 6f 75 70 2e |urces ne|wsgroup.|
|00000440| 0a 0a 23 21 20 2f 62 69 | 6e 2f 73 68 0a 23 20 54 |..#! /bi|n/sh.# T|
|00000450| 68 69 73 20 69 73 20 61 | 20 73 68 65 6c 6c 20 61 |his is a| shell a|
|00000460| 72 63 68 69 76 65 2e 20 | 20 52 65 6d 6f 76 65 20 |rchive. | Remove |
|00000470| 61 6e 79 74 68 69 6e 67 | 20 62 65 66 6f 72 65 20 |anything| before |
|00000480| 74 68 69 73 20 6c 69 6e | 65 2c 20 74 68 65 6e 20 |this lin|e, then |
|00000490| 75 6e 70 61 63 6b 0a 23 | 20 69 74 20 62 79 20 73 |unpack.#| it by s|
|000004a0| 61 76 69 6e 67 20 69 74 | 20 69 6e 74 6f 20 61 20 |aving it| into a |
|000004b0| 66 69 6c 65 20 61 6e 64 | 20 74 79 70 69 6e 67 20 |file and| typing |
|000004c0| 22 73 68 20 66 69 6c 65 | 22 2e 20 20 54 6f 20 6f |"sh file|". To o|
|000004d0| 76 65 72 77 72 69 74 65 | 20 65 78 69 73 74 69 6e |verwrite| existin|
|000004e0| 67 0a 23 20 66 69 6c 65 | 73 2c 20 74 79 70 65 20 |g.# file|s, type |
|000004f0| 22 73 68 20 66 69 6c 65 | 20 2d 63 22 2e 20 20 59 |"sh file| -c". Y|
|00000500| 6f 75 20 63 61 6e 20 61 | 6c 73 6f 20 66 65 65 64 |ou can a|lso feed|
|00000510| 20 74 68 69 73 20 61 73 | 20 73 74 61 6e 64 61 72 | this as| standar|
|00000520| 64 20 69 6e 70 75 74 20 | 76 69 61 0a 23 20 75 6e |d input |via.# un|
|00000530| 73 68 61 72 2c 20 6f 72 | 20 62 79 20 74 79 70 69 |shar, or| by typi|
|00000540| 6e 67 20 22 73 68 20 3c | 66 69 6c 65 22 2c 20 65 |ng "sh <|file", e|
|00000550| 2e 67 2e 2e 20 20 49 66 | 20 74 68 69 73 20 61 72 |.g.. If| this ar|
|00000560| 63 68 69 76 65 20 69 73 | 20 63 6f 6d 70 6c 65 74 |chive is| complet|
|00000570| 65 2c 20 79 6f 75 0a 23 | 20 77 69 6c 6c 20 73 65 |e, you.#| will se|
|00000580| 65 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |e the fo|llowing |
|00000590| 6d 65 73 73 61 67 65 20 | 61 74 20 74 68 65 20 65 |message |at the e|
|000005a0| 6e 64 3a 0a 23 09 09 22 | 45 6e 64 20 6f 66 20 73 |nd:.#.."|End of s|
|000005b0| 68 65 6c 6c 20 61 72 63 | 68 69 76 65 2e 22 0a 23 |hell arc|hive.".#|
|000005c0| 20 43 6f 6e 74 65 6e 74 | 73 3a 20 20 52 45 41 44 | Content|s: READ|
|000005d0| 4d 45 20 77 74 2e 63 0a | 23 20 57 72 61 70 70 65 |ME wt.c.|# Wrappe|
|000005e0| 64 20 62 79 20 70 61 74 | 40 72 77 69 6e 67 20 6f |d by pat|@rwing o|
|000005f0| 6e 20 57 65 64 20 41 75 | 67 20 31 35 20 31 39 3a |n Wed Au|g 15 19:|
|00000600| 31 35 3a 32 39 20 31 39 | 39 30 0a 50 41 54 48 3d |15:29 19|90.PATH=|
|00000610| 2f 62 69 6e 3a 2f 75 73 | 72 2f 62 69 6e 3a 2f 75 |/bin:/us|r/bin:/u|
|00000620| 73 72 2f 75 63 62 20 3b | 20 65 78 70 6f 72 74 20 |sr/ucb ;| export |
|00000630| 50 41 54 48 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |PATH.if |test -f |
|00000640| 27 52 45 41 44 4d 45 27 | 20 2d 61 20 22 24 7b 31 |'README'| -a "${1|
|00000650| 7d 22 20 21 3d 20 22 2d | 63 22 20 3b 20 74 68 65 |}" != "-|c" ; the|
|00000660| 6e 20 0a 20 20 65 63 68 | 6f 20 73 68 61 72 3a 20 |n . ech|o shar: |
|00000670| 57 69 6c 6c 20 6e 6f 74 | 20 63 6c 6f 62 62 65 72 |Will not| clobber|
|00000680| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 5c | existin|g file \|
|00000690| 22 27 52 45 41 44 4d 45 | 27 5c 22 0a 65 6c 73 65 |"'README|'\".else|
|000006a0| 0a 65 63 68 6f 20 73 68 | 61 72 3a 20 45 78 74 72 |.echo sh|ar: Extr|
|000006b0| 61 63 74 69 6e 67 20 5c | 22 27 52 45 41 44 4d 45 |acting \|"'README|
|000006c0| 27 5c 22 20 5c 28 32 36 | 36 38 20 63 68 61 72 61 |'\" \(26|68 chara|
|000006d0| 63 74 65 72 73 5c 29 0a | 73 65 64 20 22 73 2f 5e |cters\).|sed "s/^|
|000006e0| 58 2f 2f 22 20 3e 27 52 | 45 41 44 4d 45 27 20 3c |X//" >'R|EADME' <|
|000006f0| 3c 27 45 4e 44 5f 4f 46 | 5f 46 49 4c 45 27 0a 58 |<'END_OF|_FILE'.X|
|00000700| 09 09 09 09 77 74 2e 63 | 0a 58 09 09 09 09 3d 3d |....wt.c|.X....==|
|00000710| 3d 3d 0a 58 0a 54 68 69 | 73 20 69 73 20 61 20 75 |==.X.Thi|s is a u|
|00000720| 74 69 6c 20 74 68 61 74 | 20 49 20 6d 61 64 65 20 |til that| I made |
|00000730| 62 65 63 61 75 73 65 20 | 49 53 43 20 32 2e 30 2e |because |ISC 2.0.|
|00000740| 32 20 64 69 64 6e 27 74 | 20 70 72 6f 76 69 64 65 |2 didn't| provide|
|00000750| 20 61 0a 6d 65 61 6e 73 | 20 74 6f 20 72 65 74 65 | a.means| to rete|
|00000760| 6e 73 69 6f 6e 2c 20 6f | 72 20 65 72 61 73 65 20 |nsion, o|r erase |
|00000770| 63 61 72 74 72 69 64 67 | 65 20 74 61 70 65 73 20 |cartridg|e tapes |
|00000780| 74 68 61 74 20 75 73 65 | 64 20 74 68 65 20 57 61 |that use|d the Wa|
|00000790| 6e 67 74 65 6b 0a 64 72 | 69 76 65 72 20 70 72 6f |ngtek.dr|iver pro|
|000007a0| 76 69 64 65 64 20 61 73 | 20 70 61 72 74 20 6f 66 |vided as| part of|
|000007b0| 20 74 68 65 20 49 53 43 | 20 70 61 63 6b 61 67 65 | the ISC| package|
|000007c0| 2e 20 20 4f 6e 63 65 20 | 74 68 61 74 20 77 6f 72 |. Once |that wor|
|000007d0| 6b 65 64 2c 20 49 20 61 | 64 64 65 64 0a 69 6e 20 |ked, I a|dded.in |
|000007e0| 61 20 70 69 65 63 65 6d | 65 61 6c 20 66 61 73 68 |a piecem|eal fash|
|000007f0| 69 6f 6e 20 74 68 65 20 | 66 75 6e 63 74 69 6f 6e |ion the |function|
|00000800| 73 20 74 68 61 74 20 61 | 63 63 6f 6d 70 6c 69 73 |s that a|ccomplis|
|00000810| 68 65 64 20 61 20 72 65 | 77 69 6e 64 20 28 62 79 |hed a re|wind (by|
|00000820| 0a 6f 70 65 6e 69 6e 67 | 20 61 6e 64 20 63 6c 6f |.opening| and clo|
|00000830| 73 69 6e 67 20 74 68 65 | 20 64 65 76 69 63 65 29 |sing the| device)|
|00000840| 2c 20 61 6e 64 20 61 20 | 6d 65 61 6e 73 20 74 6f |, and a |means to|
|00000850| 20 73 6b 69 70 20 6f 76 | 65 72 20 64 61 74 61 20 | skip ov|er data |
|00000860| 6f 6e 20 61 6e 0a 70 61 | 72 74 69 61 6c 6c 79 20 |on an.pa|rtially |
|00000870| 66 69 6c 6c 65 64 20 63 | 61 72 74 72 69 64 67 65 |filled c|artridge|
|00000880| 2c 20 73 6f 20 6f 6e 65 | 20 63 6f 75 6c 64 20 70 |, so one| could p|
|00000890| 75 74 20 61 6e 6f 74 68 | 65 72 20 61 72 63 68 69 |ut anoth|er archi|
|000008a0| 76 65 20 6f 6e 20 69 74 | 2e 0a 54 68 65 20 66 77 |ve on it|..The fw|
|000008b0| 64 20 73 6b 69 70 20 66 | 75 6e 63 74 69 6f 6e 20 |d skip f|unction |
|000008c0| 61 6c 73 6f 20 77 6f 72 | 6b 73 20 66 6f 72 20 70 |also wor|ks for p|
|000008d0| 6f 73 69 74 69 6f 6e 69 | 6e 67 20 74 6f 20 72 65 |ositioni|ng to re|
|000008e0| 61 64 20 74 68 65 20 73 | 65 63 6f 6e 64 0a 61 72 |ad the s|econd.ar|
|000008f0| 63 68 69 76 65 2e 0a 58 | 0a 53 69 6e 63 65 20 74 |chive..X|.Since t|
|00000900| 68 65 20 64 72 69 76 65 | 72 20 6f 6e 6c 79 20 70 |he drive|r only p|
|00000910| 72 6f 76 69 64 65 73 20 | 32 20 69 6f 63 74 6c 28 |rovides |2 ioctl(|
|00000920| 29 20 6f 70 65 72 61 74 | 69 6f 6e 73 20 28 72 65 |) operat|ions (re|
|00000930| 74 65 6e 73 69 6f 6e 20 | 61 6e 64 0a 65 72 61 73 |tension |and.eras|
|00000940| 65 29 2c 20 74 68 65 20 | 72 65 77 69 6e 64 20 61 |e), the |rewind a|
|00000950| 6e 64 20 66 73 66 20 66 | 75 6e 63 74 69 6f 6e 73 |nd fsf f|unctions|
|00000960| 20 61 72 65 20 63 6f 62 | 62 6c 65 64 20 74 6f 67 | are cob|bled tog|
|00000970| 65 74 68 65 72 20 62 79 | 20 75 73 65 20 6f 66 0a |ether by| use of.|
|00000980| 6f 70 65 6e 28 29 2c 20 | 63 6c 6f 73 65 28 29 20 |open(), |close() |
|00000990| 61 6e 64 20 72 65 61 64 | 28 29 20 6f 70 65 72 61 |and read|() opera|
|000009a0| 74 69 6f 6e 73 20 2d 20 | 69 6e 20 6f 74 68 65 72 |tions - |in other|
|000009b0| 20 77 6f 72 64 73 2c 20 | 66 61 6b 65 64 2e 0a 54 | words, |faked..T|
|000009c0| 68 65 20 66 73 66 20 28 | 66 6f 72 77 61 72 64 20 |he fsf (|forward |
|000009d0| 73 6b 69 70 20 66 69 6c | 65 29 20 74 61 6b 65 73 |skip fil|e) takes|
|000009e0| 20 61 6e 20 6f 70 74 69 | 6f 6e 61 6c 20 63 6f 75 | an opti|onal cou|
|000009f0| 6e 74 2c 20 62 75 74 20 | 62 65 63 61 75 73 65 0a |nt, but |because.|
|00000a00| 6f 66 20 74 68 65 20 6c | 69 6d 69 74 61 74 69 6f |of the l|imitatio|
|00000a10| 6e 73 20 6f 66 20 74 68 | 65 20 64 72 69 76 65 72 |ns of th|e driver|
|00000a20| 2c 20 69 74 20 64 6f 65 | 73 6e 27 74 20 68 61 6e |, it doe|sn't han|
|00000a30| 64 6c 65 20 61 20 63 6f | 75 6e 74 20 67 72 65 61 |dle a co|unt grea|
|00000a40| 74 65 72 0a 74 68 61 6e | 20 74 68 65 20 6e 75 6d |ter.than| the num|
|00000a50| 62 65 72 20 6f 66 20 66 | 69 6c 65 73 20 74 6f 20 |ber of f|iles to |
|00000a60| 73 6b 69 70 20 67 72 61 | 63 65 66 75 6c 6c 79 2c |skip gra|cefully,|
|00000a70| 20 61 6e 64 20 65 6e 64 | 73 20 75 70 20 70 6f 73 | and end|s up pos|
|00000a80| 69 74 69 6f 6e 69 6e 67 | 0a 74 68 65 20 74 61 70 |itioning|.the tap|
|00000a90| 65 20 69 6e 20 61 20 75 | 73 65 6c 65 73 73 20 70 |e in a u|seless p|
|00000aa0| 6f 73 69 74 69 6f 6e 2e | 20 20 41 20 72 65 77 69 |osition.| A rewi|
|00000ab0| 6e 64 20 69 73 20 6e 65 | 65 64 65 64 20 74 6f 20 |nd is ne|eded to |
|00000ac0| 67 65 74 20 74 68 69 6e | 67 73 0a 73 71 75 61 72 |get thin|gs.squar|
|00000ad0| 65 64 20 61 77 61 79 20 | 61 67 61 69 6e 2e 20 20 |ed away |again. |
|00000ae0| 53 74 69 6c 6c 2c 20 69 | 74 73 20 68 61 6e 64 79 |Still, i|ts handy|
|00000af0| 20 69 66 20 6f 6e 65 20 | 64 6f 65 73 6e 27 74 20 | if one |doesn't |
|00000b00| 74 65 6c 6c 20 69 74 20 | 74 6f 0a 67 6f 20 70 61 |tell it |to.go pa|
|00000b10| 73 74 20 74 68 65 20 6c | 61 73 74 20 72 65 63 6f |st the l|ast reco|
|00000b20| 72 64 2e 0a 58 0a 54 68 | 65 20 75 74 69 6c 20 64 |rd..X.Th|e util d|
|00000b30| 65 66 61 75 6c 74 73 20 | 74 6f 20 75 73 65 20 74 |efaults |to use t|
|00000b40| 68 65 20 64 65 76 69 63 | 65 73 20 74 68 61 74 20 |he devic|es that |
|00000b50| 61 72 65 20 6e 6f 72 6d | 61 6c 6c 79 20 63 72 65 |are norm|ally cre|
|00000b60| 61 74 65 64 20 77 68 65 | 6e 0a 74 68 65 20 57 61 |ated whe|n.the Wa|
|00000b70| 6e 67 74 65 6b 20 64 72 | 69 76 65 72 20 69 73 20 |ngtek dr|iver is |
|00000b80| 63 6f 6e 66 69 67 75 72 | 65 64 2c 20 77 69 74 68 |configur|ed, with|
|00000b90| 20 70 72 6f 76 69 73 69 | 6f 6e 20 74 6f 20 74 72 | provisi|on to tr|
|00000ba0| 79 20 74 68 65 20 73 65 | 76 65 72 61 6c 0a 61 6c |y the se|veral.al|
|00000bb0| 74 65 72 6e 61 74 65 20 | 6e 61 6d 65 73 20 69 6e |ternate |names in|
|00000bc0| 20 63 61 73 65 20 6f 6e | 65 20 6f 72 20 6d 6f 72 | case on|e or mor|
|00000bd0| 65 20 69 73 20 72 65 6d | 6f 76 65 64 2c 20 65 74 |e is rem|oved, et|
|00000be0| 63 2e 20 20 4f 6e 65 20 | 63 61 6e 20 61 6c 73 6f |c. One |can also|
|00000bf0| 0a 73 70 65 63 69 66 79 | 20 74 68 65 20 64 65 76 |.specify| the dev|
|00000c00| 69 63 65 20 74 6f 20 61 | 63 63 65 73 73 20 75 73 |ice to a|ccess us|
|00000c10| 69 6e 67 20 74 68 65 20 | 6f 6e 65 20 61 6e 64 20 |ing the |one and |
|00000c20| 6f 6e 6c 79 20 6f 70 74 | 69 6f 6e 2c 20 2d 66 2e |only opt|ion, -f.|
|00000c30| 0a 58 0a 54 68 69 73 20 | 74 68 69 6e 67 20 69 73 |.X.This |thing is|
|00000c40| 20 61 6e 79 74 68 69 6e | 67 20 62 75 74 20 65 6c | anythin|g but el|
|00000c50| 65 67 61 6e 74 2c 20 62 | 75 74 20 69 74 20 69 73 |egant, b|ut it is|
|00000c60| 20 6f 6e 65 20 61 70 70 | 72 6f 61 63 68 20 74 6f | one app|roach to|
|00000c70| 20 74 68 65 0a 71 75 65 | 73 74 69 6f 6e 20 6f 66 | the.que|stion of|
|00000c80| 20 68 6f 77 20 64 6f 65 | 73 20 6f 6e 65 20 64 6f | how doe|s one do|
|00000c90| 20 74 68 65 73 65 20 6f | 70 65 72 61 74 69 6f 6e | these o|peration|
|00000ca0| 73 20 6f 6e 20 61 20 63 | 61 72 74 72 69 64 67 65 |s on a c|artridge|
|00000cb0| 20 74 61 70 65 20 75 6e | 64 65 72 0a 49 53 43 20 | tape un|der.ISC |
|00000cc0| 76 65 72 73 69 6f 6e 20 | 32 2e 30 2e 32 2e 20 20 |version |2.0.2. |
|00000cd0| 4d 6f 72 65 20 69 6e 66 | 6f 20 61 73 20 74 6f 20 |More inf|o as to |
|00000ce0| 68 6f 77 20 69 74 73 20 | 75 73 65 64 20 69 73 20 |how its |used is |
|00000cf0| 69 6e 20 74 68 65 20 73 | 6f 75 72 63 65 2e 0a 4e |in the s|ource..N|
|00000d00| 6f 20 6d 61 6b 65 66 69 | 6c 65 20 69 73 20 6e 65 |o makefi|le is ne|
|00000d10| 65 64 65 64 20 2d 20 77 | 69 74 68 20 77 74 2e 63 |eded - w|ith wt.c|
|00000d20| 20 69 6e 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | in the |current |
|00000d30| 77 6f 72 6b 69 6e 67 20 | 64 69 72 65 63 74 6f 72 |working |director|
|00000d40| 79 0a 73 69 6d 70 6c 79 | 20 74 79 70 65 20 60 60 |y.simply| type ``|
|00000d50| 6d 61 6b 65 20 77 74 27 | 27 2c 20 6f 72 20 69 66 |make wt'|', or if|
|00000d60| 20 79 6f 75 20 70 72 65 | 66 65 72 2c 20 75 73 65 | you pre|fer, use|
|00000d70| 20 74 68 69 73 20 63 6f | 6d 6d 61 6e 64 3a 0a 58 | this co|mmand:.X|
|00000d80| 60 60 63 63 20 2d 4f 20 | 2d 73 20 77 74 2e 63 20 |``cc -O |-s wt.c |
|00000d90| 2d 6f 20 77 74 20 2d 6c | 63 5f 73 27 27 2e 20 20 |-o wt -l|c_s''. |
|00000da0| 54 68 69 73 20 77 69 6c | 6c 20 6d 61 6b 65 20 61 |This wil|l make a|
|00000db0| 20 73 6d 61 6c 6c 65 72 | 20 65 78 65 63 75 74 61 | smaller| executa|
|00000dc0| 62 6c 65 0a 62 65 63 61 | 75 73 65 20 69 74 20 75 |ble.beca|use it u|
|00000dd0| 73 65 73 20 74 68 65 20 | 73 68 61 72 65 64 20 6c |ses the |shared l|
|00000de0| 69 62 72 61 72 79 2e 0a | 58 0a 44 49 53 43 4c 41 |ibrary..|X.DISCLA|
|00000df0| 49 4d 45 52 3a 20 20 4e | 6f 20 67 75 61 72 61 6e |IMER: N|o guaran|
|00000e00| 74 65 65 73 20 61 72 65 | 20 6d 61 64 65 20 72 65 |tees are| made re|
|00000e10| 67 61 72 64 69 6e 67 20 | 73 75 69 74 61 62 69 6c |garding |suitabil|
|00000e20| 69 74 79 20 6f 72 0a 63 | 6f 72 72 65 63 74 6e 65 |ity or.c|orrectne|
|00000e30| 73 73 20 6f 66 20 77 74 | 2e 63 2c 20 65 73 70 65 |ss of wt|.c, espe|
|00000e40| 63 69 61 6c 6c 79 20 77 | 68 65 6e 20 75 73 65 64 |cially w|hen used|
|00000e50| 20 74 6f 20 70 6f 73 69 | 74 69 6f 6e 20 74 68 65 | to posi|tion the|
|00000e60| 20 74 61 70 65 20 74 6f | 20 70 75 74 0a 6d 6f 72 | tape to| put.mor|
|00000e70| 65 20 74 68 61 6e 20 6f | 6e 65 20 61 72 63 68 69 |e than o|ne archi|
|00000e80| 76 65 20 6f 6e 20 61 20 | 74 61 70 65 2e 20 20 49 |ve on a |tape. I|
|00000e90| 66 20 6f 6e 65 20 64 6f | 65 73 6e 27 74 20 6b 6e |f one do|esn't kn|
|00000ea0| 6f 77 20 77 68 61 74 20 | 74 68 65 79 20 61 72 65 |ow what |they are|
|00000eb0| 0a 64 6f 69 6e 67 2c 20 | 75 73 69 6e 67 20 74 68 |.doing, |using th|
|00000ec0| 65 20 66 73 66 20 6f 70 | 74 69 6f 6e 20 63 6f 75 |e fsf op|tion cou|
|00000ed0| 6c 64 20 73 65 74 20 79 | 6f 75 20 75 70 20 74 6f |ld set y|ou up to|
|00000ee0| 20 6c 6f 73 65 20 64 61 | 74 61 20 2d 20 61 73 20 | lose da|ta - as |
|00000ef0| 69 6e 20 74 68 65 0a 63 | 61 73 65 20 77 68 65 72 |in the.c|ase wher|
|00000f00| 65 20 61 20 73 65 63 6f | 6e 64 20 61 72 63 68 69 |e a seco|nd archi|
|00000f10| 76 65 20 69 73 20 70 72 | 65 73 65 6e 74 2c 20 61 |ve is pr|esent, a|
|00000f20| 6e 64 20 6f 6e 65 20 72 | 65 70 6c 61 63 65 73 20 |nd one r|eplaces |
|00000f30| 74 68 65 20 66 69 72 73 | 74 20 6f 6e 65 0a 6f 6e |the firs|t one.on|
|00000f40| 20 74 68 65 20 74 61 70 | 65 2e 20 20 53 65 63 6f | the tap|e. Seco|
|00000f50| 6e 64 20 66 69 6c 65 73 | 20 6f 72 20 61 72 63 68 |nd files| or arch|
|00000f60| 69 76 65 73 20 6f 6e 20 | 61 20 74 61 70 65 20 61 |ives on |a tape a|
|00000f70| 72 65 20 6e 6f 74 20 61 | 20 67 72 65 61 74 20 69 |re not a| great i|
|00000f80| 64 65 61 0a 75 6e 6c 65 | 73 73 20 6f 6e 65 20 4b |dea.unle|ss one K|
|00000f90| 4e 4f 57 53 20 74 68 61 | 74 20 74 68 65 79 20 77 |NOWS tha|t they w|
|00000fa0| 69 6c 6c 20 6e 6f 74 20 | 62 65 20 61 6c 74 65 72 |ill not |be alter|
|00000fb0| 69 6e 67 20 74 68 65 20 | 70 72 65 63 65 65 64 69 |ing the |preceedi|
|00000fc0| 6e 67 0a 61 72 63 68 69 | 76 65 2e 20 20 49 66 20 |ng.archi|ve. If |
|00000fd0| 6f 6e 65 20 68 61 73 20 | 74 6f 20 63 68 61 6e 67 |one has |to chang|
|00000fe0| 65 20 74 68 65 20 70 72 | 65 63 65 65 64 69 6e 67 |e the pr|eceeding|
|00000ff0| 20 61 72 63 68 69 76 65 | 73 2c 20 72 65 61 64 20 | archive|s, read |
|00001000| 41 4c 4c 20 74 68 65 0a | 64 61 74 61 20 6f 66 66 |ALL the.|data off|
|00001010| 20 74 68 65 20 63 61 72 | 74 72 69 64 67 65 2c 20 | the car|tridge, |
|00001020| 6f 72 20 70 75 74 20 74 | 68 65 20 63 68 61 6e 67 |or put t|he chang|
|00001030| 65 64 20 61 72 63 68 69 | 76 65 20 6f 6e 20 61 6e |ed archi|ve on an|
|00001040| 6f 74 68 65 72 0a 63 61 | 72 74 72 69 64 67 65 2c |other.ca|rtridge,|
|00001050| 20 61 6e 64 20 74 68 65 | 6e 2c 20 69 66 20 6e 65 | and the|n, if ne|
|00001060| 63 65 73 73 61 72 79 2c | 20 63 6f 70 79 20 74 68 |cessary,| copy th|
|00001070| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 61 72 63 68 |e follow|ing arch|
|00001080| 69 76 65 73 20 6f 66 66 | 20 74 68 65 0a 70 72 65 |ives off| the.pre|
|00001090| 76 69 6f 75 73 20 63 74 | 67 20 61 6e 64 20 61 64 |vious ct|g and ad|
|000010a0| 64 20 74 68 65 6d 20 74 | 6f 20 74 68 65 20 6e 65 |d them t|o the ne|
|000010b0| 77 20 6f 6e 65 2e 20 20 | 4f 6e 65 20 63 61 6e 6e |w one. |One cann|
|000010c0| 6f 74 20 63 68 61 6e 67 | 65 20 74 68 65 20 73 69 |ot chang|e the si|
|000010d0| 7a 65 0a 6f 66 20 61 72 | 63 68 69 76 65 73 20 6f |ze.of ar|chives o|
|000010e0| 6e 20 61 20 74 61 70 65 | 20 77 69 74 68 6f 75 74 |n a tape| without|
|000010f0| 20 63 6c 6f 62 62 65 72 | 69 6e 67 20 66 6f 6c 6c | clobber|ing foll|
|00001100| 6f 77 69 6e 67 20 61 72 | 63 68 69 76 65 73 20 61 |owing ar|chives a|
|00001110| 73 20 6f 6e 65 20 63 61 | 6e 0a 64 6f 20 6f 6e 20 |s one ca|n.do on |
|00001120| 61 20 66 6c 6f 70 70 79 | 20 64 69 73 6b 2e 20 20 |a floppy| disk. |
|00001130| 55 73 65 20 63 6f 6d 6d | 6f 6e 20 73 65 6e 73 65 |Use comm|on sense|
|00001140| 20 68 65 72 65 2e 0a 58 | 0a 58 45 6e 6a 6f 79 2c | here..X|.XEnjoy,|
|00001150| 20 62 75 74 20 61 74 20 | 79 6f 75 72 20 6f 77 6e | but at |your own|
|00001160| 20 72 69 73 6b 2e 09 09 | 09 09 70 61 74 40 72 77 | risk...|..pat@rw|
|00001170| 69 6e 67 0a 58 0a 45 4e | 44 5f 4f 46 5f 46 49 4c |ing.X.EN|D_OF_FIL|
|00001180| 45 0a 69 66 20 74 65 73 | 74 20 32 36 36 38 20 2d |E.if tes|t 2668 -|
|00001190| 6e 65 20 60 77 63 20 2d | 63 20 3c 27 52 45 41 44 |ne `wc -|c <'READ|
|000011a0| 4d 45 27 60 3b 20 74 68 | 65 6e 0a 20 20 20 20 65 |ME'`; th|en. e|
|000011b0| 63 68 6f 20 73 68 61 72 | 3a 20 5c 22 27 52 45 41 |cho shar|: \"'REA|
|000011c0| 44 4d 45 27 5c 22 20 75 | 6e 70 61 63 6b 65 64 20 |DME'\" u|npacked |
|000011d0| 77 69 74 68 20 77 72 6f | 6e 67 20 73 69 7a 65 21 |with wro|ng size!|
|000011e0| 0a 66 69 0a 23 20 65 6e | 64 20 6f 66 20 27 52 45 |.fi.# en|d of 'RE|
|000011f0| 41 44 4d 45 27 0a 66 69 | 0a 69 66 20 74 65 73 74 |ADME'.fi|.if test|
|00001200| 20 2d 66 20 27 77 74 2e | 63 27 20 2d 61 20 22 24 | -f 'wt.|c' -a "$|
|00001210| 7b 31 7d 22 20 21 3d 20 | 22 2d 63 22 20 3b 20 74 |{1}" != |"-c" ; t|
|00001220| 68 65 6e 20 0a 20 20 65 | 63 68 6f 20 73 68 61 72 |hen . e|cho shar|
|00001230| 3a 20 57 69 6c 6c 20 6e | 6f 74 20 63 6c 6f 62 62 |: Will n|ot clobb|
|00001240| 65 72 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |er exist|ing file|
|00001250| 20 5c 22 27 77 74 2e 63 | 27 5c 22 0a 65 6c 73 65 | \"'wt.c|'\".else|
|00001260| 0a 65 63 68 6f 20 73 68 | 61 72 3a 20 45 78 74 72 |.echo sh|ar: Extr|
|00001270| 61 63 74 69 6e 67 20 5c | 22 27 77 74 2e 63 27 5c |acting \|"'wt.c'\|
|00001280| 22 20 5c 28 35 36 30 30 | 20 63 68 61 72 61 63 74 |" \(5600| charact|
|00001290| 65 72 73 5c 29 0a 73 65 | 64 20 22 73 2f 5e 58 2f |ers\).se|d "s/^X/|
|000012a0| 2f 22 20 3e 27 77 74 2e | 63 27 20 3c 3c 27 45 4e |/" >'wt.|c' <<'EN|
|000012b0| 44 5f 4f 46 5f 46 49 4c | 45 27 0a 58 2f 2a 09 40 |D_OF_FIL|E'.X/*.@|
|000012c0| 28 23 29 20 77 74 2e 63 | 20 2d 20 61 20 57 61 6e |(#) wt.c| - a Wan|
|000012d0| 67 74 65 6b 20 63 6f 6d | 6d 61 6e 64 20 75 74 69 |gtek com|mand uti|
|000012e0| 6c 69 74 79 2e 0a 58 20 | 2a 09 41 20 75 74 69 6c |lity..X |*.A util|
|000012f0| 69 74 79 20 74 6f 20 69 | 73 73 75 65 20 74 68 65 |ity to i|ssue the|
|00001300| 20 69 6f 63 74 6c 28 32 | 29 20 63 6f 6d 6d 61 6e | ioctl(2|) comman|
|00001310| 64 73 20 74 6f 20 72 65 | 74 65 6e 73 69 6f 6e 0a |ds to re|tension.|
|00001320| 58 20 2a 09 61 6e 64 2f | 6f 72 20 65 72 61 73 65 |X *.and/|or erase|
|00001330| 20 63 61 72 74 72 69 64 | 67 65 20 74 61 70 65 73 | cartrid|ge tapes|
|00001340| 20 75 73 69 6e 67 20 74 | 68 65 20 57 61 6e 67 74 | using t|he Wangt|
|00001350| 65 6b 20 28 77 74 29 20 | 64 72 69 76 65 72 2e 0a |ek (wt) |driver..|
|00001360| 58 20 2a 09 54 68 65 72 | 65 20 77 61 73 20 6e 6f |X *.Ther|e was no|
|00001370| 20 77 61 79 20 74 6f 20 | 61 63 63 6f 6d 70 6c 69 | way to |accompli|
|00001380| 73 68 20 74 68 69 73 20 | 70 72 6f 76 69 64 65 64 |sh this |provided|
|00001390| 20 77 69 74 68 20 74 68 | 65 20 73 79 73 74 65 6d | with th|e system|
|000013a0| 2c 0a 58 20 2a 09 61 6e | 64 20 77 68 69 6c 65 20 |,.X *.an|d while |
|000013b0| 74 72 69 76 69 61 6c 2c | 20 6f 6e 65 20 6e 65 65 |trivial,| one nee|
|000013c0| 64 73 20 74 6f 20 62 65 | 20 61 62 6c 65 20 74 6f |ds to be| able to|
|000013d0| 20 72 65 74 65 6e 73 69 | 6f 6e 20 6e 65 77 20 74 | retensi|on new t|
|000013e0| 61 70 65 73 0a 58 20 2a | 09 61 6e 64 20 73 6f 6d |apes.X *|.and som|
|000013f0| 65 74 69 6d 65 73 20 65 | 72 61 73 65 20 63 61 72 |etimes e|rase car|
|00001400| 74 72 69 64 67 65 73 2c | 20 74 6f 20 72 65 6d 6f |tridges,| to remo|
|00001410| 76 65 20 72 65 63 6f 72 | 64 73 20 74 68 61 74 20 |ve recor|ds that |
|00001420| 63 6f 6e 66 75 73 65 0a | 58 20 2a 09 74 68 65 20 |confuse.|X *.the |
|00001430| 6c 65 73 73 2d 74 68 61 | 6e 2d 67 72 65 61 74 20 |less-tha|n-great |
|00001440| 57 61 6e 67 74 65 6b 20 | 64 72 69 76 65 72 20 70 |Wangtek |driver p|
|00001450| 72 6f 76 69 64 65 64 20 | 62 79 20 49 53 43 2e 20 |rovided |by ISC. |
|00001460| 20 53 6f 6d 65 20 6f 74 | 68 65 72 0a 58 20 2a 09 | Some ot|her.X *.|
|00001470| 62 61 73 69 63 20 6f 70 | 73 20 61 64 64 65 64 20 |basic op|s added |
|00001480| 61 73 20 74 69 6d 65 20 | 70 61 73 73 65 64 20 74 |as time |passed t|
|00001490| 68 61 74 2c 20 77 68 69 | 6c 65 20 70 6f 73 73 69 |hat, whi|le possi|
|000014a0| 62 6c 65 20 62 79 20 70 | 72 6f 70 65 72 0a 58 20 |ble by p|roper.X |
|000014b0| 2a 09 63 6f 6d 6d 61 6e | 64 20 6c 69 6e 65 20 6f |*.comman|d line o|
|000014c0| 70 65 72 61 74 69 6f 6e | 73 20 75 73 69 6e 67 20 |peration|s using |
|000014d0| 76 61 72 69 6f 75 73 20 | 63 6f 6d 6d 61 6e 64 73 |various |commands|
|000014e0| 2c 20 74 68 65 73 65 20 | 77 65 72 65 20 61 77 6b |, these |were awk|
|000014f0| 77 61 72 64 0a 58 20 2a | 09 61 6e 64 20 65 72 72 |ward.X *|.and err|
|00001500| 6f 72 20 70 72 6f 6e 65 | 2e 20 20 54 68 69 73 20 |or prone|. This |
|00001510| 6b 6c 75 64 67 65 20 68 | 65 6c 70 73 20 61 20 6c |kludge h|elps a l|
|00001520| 69 74 74 6c 65 20 62 69 | 74 2e 0a 58 20 2a 09 4f |ittle bi|t..X *.O|
|00001530| 66 20 63 6f 75 72 73 65 | 2c 20 74 68 65 20 52 45 |f course|, the RE|
|00001540| 41 4c 20 61 6e 73 77 65 | 72 20 69 73 20 61 20 64 |AL answe|r is a d|
|00001550| 65 63 65 6e 74 20 64 72 | 69 76 65 72 2c 20 61 6e |ecent dr|iver, an|
|00001560| 64 20 70 72 6f 70 65 72 | 20 73 75 70 70 6f 72 74 |d proper| support|
|00001570| 0a 58 20 2a 09 75 74 69 | 6c 69 74 69 65 73 2e 0a |.X *.uti|lities..|
|00001580| 58 20 2a 0a 58 20 2a 09 | 54 68 69 73 20 74 68 69 |X *.X *.|This thi|
|00001590| 6e 67 20 77 69 6c 6c 20 | 74 72 79 20 2f 64 65 76 |ng will |try /dev|
|000015a0| 2f 72 6d 74 30 2c 20 69 | 66 20 74 68 61 74 20 66 |/rmt0, i|f that f|
|000015b0| 61 69 6c 73 2c 20 69 74 | 20 77 69 6c 6c 20 6c 6f |ails, it| will lo|
|000015c0| 6f 6b 20 61 74 0a 58 20 | 2a 09 2f 64 65 76 2f 74 |ok at.X |*./dev/t|
|000015d0| 61 70 65 2c 20 74 68 65 | 6e 20 2f 64 65 76 2f 72 |ape, the|n /dev/r|
|000015e0| 53 41 2f 72 6d 74 30 2e | 20 20 49 66 20 67 69 76 |SA/rmt0.| If giv|
|000015f0| 65 6e 20 61 20 6e 61 6d | 65 20 76 69 61 20 2d 66 |en a nam|e via -f|
|00001600| 20 6f 70 74 69 6f 6e 20 | 69 74 0a 58 20 2a 09 77 | option |it.X *.w|
|00001610| 69 6c 6c 20 74 72 79 20 | 6f 6e 6c 79 20 74 68 61 |ill try |only tha|
|00001620| 74 20 6e 61 6d 65 2e 0a | 58 20 2a 0a 58 20 2a 09 |t name..|X *.X *.|
|00001630| 54 6f 73 73 65 64 20 74 | 6f 67 65 74 68 65 72 20 |Tossed t|ogether |
|00001640| 28 6c 69 74 65 72 61 6c | 6c 79 29 20 62 79 20 70 |(literal|ly) by p|
|00001650| 61 74 40 72 77 69 6e 67 | 20 46 72 69 20 41 75 67 |at@rwing| Fri Aug|
|00001660| 20 31 30 20 32 32 3a 35 | 34 3a 34 34 20 50 44 54 | 10 22:5|4:44 PDT|
|00001670| 20 31 39 39 30 0a 58 20 | 2a 0a 58 20 2a 09 50 6c | 1990.X |*.X *.Pl|
|00001680| 61 63 65 64 20 69 6e 20 | 74 68 65 20 50 75 62 6c |aced in |the Publ|
|00001690| 69 63 20 44 6f 6d 61 69 | 6e 20 62 79 20 70 61 74 |ic Domai|n by pat|
|000016a0| 40 72 77 69 6e 67 2e 0a | 58 20 2a 2f 0a 58 0a 58 |@rwing..|X */.X.X|
|000016b0| 23 69 6e 63 6c 75 64 65 | 20 3c 73 79 73 2f 77 74 |#include| <sys/wt|
|000016c0| 69 6f 63 74 6c 2e 68 3e | 0a 58 23 69 6e 63 6c 75 |ioctl.h>|.X#inclu|
|000016d0| 64 65 20 3c 73 74 64 69 | 6f 2e 68 3e 0a 58 23 69 |de <stdi|o.h>.X#i|
|000016e0| 6e 63 6c 75 64 65 20 3c | 65 72 72 6e 6f 2e 68 3e |nclude <|errno.h>|
|000016f0| 0a 58 23 69 6e 63 6c 75 | 64 65 20 3c 66 63 6e 74 |.X#inclu|de <fcnt|
|00001700| 6c 2e 68 3e 0a 58 0a 58 | 23 64 65 66 69 6e 65 09 |l.h>.X.X|#define.|
|00001710| 4e 4f 45 4e 54 53 20 34 | 0a 58 0a 58 2f 2a 20 48 |NOENTS 4|.X.X/* H|
|00001720| 55 4e 4b 0a 58 20 2a 20 | 73 69 7a 65 20 6f 66 20 |UNK.X * |size of |
|00001730| 72 65 61 64 28 29 20 72 | 65 71 75 65 73 74 73 20 |read() r|equests |
|00001740| 77 68 65 6e 20 73 63 61 | 6e 6e 69 6e 67 20 6f 76 |when sca|nning ov|
|00001750| 65 72 20 64 61 74 61 20 | 2d 20 49 20 68 65 61 72 |er data |- I hear|
|00001760| 64 20 74 68 61 74 20 63 | 74 67 0a 58 20 2a 20 74 |d that c|tg.X * t|
|00001770| 61 70 65 73 20 62 6c 6f | 63 6b 20 61 74 20 36 33 |apes blo|ck at 63|
|00001780| 6b 2c 20 70 65 72 66 6f | 72 6d 61 6e 63 65 20 74 |k, perfo|rmance t|
|00001790| 72 69 61 6c 73 20 74 65 | 6e 64 20 74 6f 20 62 65 |rials te|nd to be|
|000017a0| 61 72 20 74 68 69 73 20 | 6f 75 74 2e 0a 58 20 2a |ar this |out..X *|
|000017b0| 2f 0a 58 23 64 65 66 69 | 6e 65 20 48 55 4e 4b 20 |/.X#defi|ne HUNK |
|000017c0| 36 34 35 31 32 0a 58 0a | 76 6f 69 64 09 65 78 69 |64512.X.|void.exi|
|000017d0| 74 28 29 3b 09 09 2f 2a | 20 74 6f 20 6b 65 65 70 |t();../*| to keep|
|000017e0| 20 6c 69 6e 74 28 31 29 | 20 73 6d 69 6c 69 6e 67 | lint(1)| smiling|
|000017f0| 20 2a 2f 0a 76 6f 69 64 | 09 75 73 61 67 65 28 29 | */.void|.usage()|
|00001800| 3b 0a 58 0a 58 2f 2a 20 | 75 73 75 61 6c 20 64 65 |;.X.X/* |usual de|
|00001810| 66 61 75 6c 74 20 6e 61 | 6d 65 73 20 66 6f 72 20 |fault na|mes for |
|00001820| 74 68 65 20 6e 6f 72 6d | 61 6c 20 72 65 77 69 6e |the norm|al rewin|
|00001830| 64 2d 6f 6e 2d 63 6c 6f | 73 65 20 64 65 76 69 63 |d-on-clo|se devic|
|00001840| 65 20 2a 2f 0a 63 68 61 | 72 20 2a 74 61 70 65 5b |e */.cha|r *tape[|
|00001850| 4e 4f 45 4e 54 53 5d 20 | 3d 20 7b 0a 58 09 22 2f |NOENTS] |= {.X."/|
|00001860| 64 65 76 2f 72 6d 74 30 | 22 2c 0a 58 09 22 2f 64 |dev/rmt0|",.X."/d|
|00001870| 65 76 2f 74 61 70 65 22 | 2c 0a 58 09 22 2f 64 65 |ev/tape"|,.X."/de|
|00001880| 76 2f 72 53 41 2f 74 61 | 70 65 22 2c 0a 58 09 28 |v/rSA/ta|pe",.X.(|
|00001890| 63 68 61 72 20 2a 29 4e | 55 4c 4c 0a 58 7d 3b 0a |char *)N|ULL.X};.|
|000018a0| 58 0a 58 2f 2a 20 75 73 | 75 61 6c 20 64 65 66 61 |X.X/* us|ual defa|
|000018b0| 75 6c 74 20 6e 61 6d 65 | 73 20 66 6f 72 20 74 68 |ult name|s for th|
|000018c0| 65 20 4e 4f 20 72 65 77 | 69 6e 64 2d 6f 6e 2d 63 |e NO rew|ind-on-c|
|000018d0| 6c 6f 73 65 20 64 65 76 | 69 63 65 20 2a 2f 0a 63 |lose dev|ice */.c|
|000018e0| 68 61 72 20 2a 6e 74 61 | 70 65 5b 4e 4f 45 4e 54 |har *nta|pe[NOENT|
|000018f0| 53 5d 20 3d 20 7b 0a 58 | 09 22 2f 64 65 76 2f 72 |S] = {.X|."/dev/r|
|00001900| 6e 6d 74 30 22 2c 0a 58 | 09 22 2f 64 65 76 2f 6e |nmt0",.X|."/dev/n|
|00001910| 74 61 70 65 22 2c 0a 58 | 09 22 2f 64 65 76 2f 72 |tape",.X|."/dev/r|
|00001920| 53 41 2f 6e 74 61 70 65 | 22 2c 0a 58 09 28 63 68 |SA/ntape|",.X.(ch|
|00001930| 61 72 20 2a 29 4e 55 4c | 4c 0a 58 7d 3b 0a 58 0a |ar *)NUL|L.X};.X.|
|00001940| 58 2f 2a 20 66 6f 75 6e | 64 61 74 69 6f 6e 20 6f |X/* foun|dation o|
|00001950| 66 20 61 20 63 6f 75 70 | 6c 65 20 6f 66 20 63 6f |f a coup|le of co|
|00001960| 6d 6d 6f 6e 6c 79 20 75 | 73 65 64 20 65 72 72 6f |mmonly u|sed erro|
|00001970| 72 20 6d 65 73 73 61 67 | 65 73 20 2a 2f 0a 63 68 |r messag|es */.ch|
|00001980| 61 72 20 6d 73 67 66 6d | 74 5b 5d 20 3d 20 22 55 |ar msgfm|t[] = "U|
|00001990| 6e 61 62 6c 65 20 74 6f | 20 6f 70 65 6e 20 74 61 |nable to| open ta|
|000019a0| 70 65 20 66 6f 72 20 25 | 73 5c 6e 22 3b 0a 63 68 |pe for %|s\n";.ch|
|000019b0| 61 72 20 65 72 72 6e 6f | 66 6d 74 5b 5d 20 3d 20 |ar errno|fmt[] = |
|000019c0| 22 52 65 74 75 72 6e 20 | 66 72 6f 6d 20 65 72 72 |"Return |from err|
|000019d0| 6e 6f 20 3d 20 25 64 5c | 6e 22 3b 0a 65 78 74 65 |no = %d\|n";.exte|
|000019e0| 72 6e 20 69 6e 74 20 65 | 72 72 6e 6f 3b 0a 58 0a |rn int e|rrno;.X.|
|000019f0| 6d 61 69 6e 28 61 72 67 | 63 2c 20 61 72 67 76 29 |main(arg|c, argv)|
|00001a00| 0a 69 6e 74 20 61 72 67 | 63 3b 0a 63 68 61 72 20 |.int arg|c;.char |
|00001a10| 2a 2a 61 72 67 76 3b 0a | 58 7b 0a 58 20 20 20 20 |**argv;.|X{.X |
|00001a20| 69 6e 74 20 66 64 2c 20 | 69 2c 20 6a 2c 20 63 6f |int fd, |i, j, co|
|00001a30| 75 6e 74 2c 20 72 65 73 | 75 6c 74 3b 0a 58 20 20 |unt, res|ult;.X |
|00001a40| 20 20 63 68 61 72 20 73 | 63 72 61 74 63 68 5b 48 | char s|cratch[H|
|00001a50| 55 4e 4b 5d 3b 09 2f 2a | 20 62 75 66 66 65 72 20 |UNK];./*| buffer |
|00001a60| 66 6f 72 20 72 65 61 64 | 73 20 74 6f 20 73 63 61 |for read|s to sca|
|00001a70| 6e 20 6f 76 65 72 20 64 | 61 74 61 20 2a 2f 0a 58 |n over d|ata */.X|
|00001a80| 20 20 20 20 63 68 61 72 | 20 2a 63 6e 61 6d 65 3d | char| *cname=|
|00001a90| 61 72 67 76 5b 30 5d 3b | 0a 58 0a 58 20 20 20 20 |argv[0];|.X.X |
|00001aa0| 2f 2a 20 73 65 65 20 69 | 66 20 75 73 65 72 20 73 |/* see i|f user s|
|00001ab0| 70 65 63 69 66 69 65 73 | 20 61 20 64 65 76 69 63 |pecifies| a devic|
|00001ac0| 65 2c 20 61 6e 64 20 69 | 66 20 73 6f 2c 20 67 65 |e, and i|f so, ge|
|00001ad0| 74 20 69 74 73 20 6e 61 | 6d 65 20 2a 2f 0a 58 20 |t its na|me */.X |
|00001ae0| 20 20 20 69 66 20 28 2a | 61 72 67 76 5b 31 5d 20 | if (*|argv[1] |
|00001af0| 3d 3d 20 27 2d 27 29 20 | 7b 0a 58 09 69 66 20 28 |== '-') |{.X.if (|
|00001b00| 61 72 67 76 5b 31 5d 5b | 31 5d 20 3d 3d 20 27 66 |argv[1][|1] == 'f|
|00001b10| 27 29 20 7b 0a 58 09 20 | 20 20 20 69 66 20 28 61 |') {.X. | if (a|
|00001b20| 72 67 76 5b 31 5d 5b 32 | 5d 20 21 3d 20 27 5c 30 |rgv[1][2|] != '\0|
|00001b30| 27 29 20 7b 0a 58 09 09 | 6e 74 61 70 65 5b 30 5d |') {.X..|ntape[0]|
|00001b40| 20 3d 20 74 61 70 65 5b | 30 5d 20 3d 20 26 61 72 | = tape[|0] = &ar|
|00001b50| 67 76 5b 31 5d 5b 32 5d | 3b 0a 58 09 09 61 72 67 |gv[1][2]|;.X..arg|
|00001b60| 76 20 2b 3d 20 31 3b 20 | 61 72 67 63 20 2d 3d 20 |v += 1; |argc -= |
|00001b70| 31 3b 0a 58 09 20 20 20 | 20 7d 20 65 6c 73 65 20 |1;.X. | } else |
|00001b80| 7b 0a 58 09 09 6e 74 61 | 70 65 5b 30 5d 20 3d 20 |{.X..nta|pe[0] = |
|00001b90| 74 61 70 65 5b 30 5d 20 | 3d 20 61 72 67 76 5b 32 |tape[0] |= argv[2|
|00001ba0| 5d 3b 0a 58 09 09 61 72 | 67 76 20 2b 3d 20 32 3b |];.X..ar|gv += 2;|
|00001bb0| 20 61 72 67 63 20 2d 3d | 20 32 3b 0a 58 09 20 20 | argc -=| 2;.X. |
|00001bc0| 20 20 7d 0a 58 09 20 20 | 20 20 6e 74 61 70 65 5b | }.X. | ntape[|
|00001bd0| 31 5d 20 3d 20 74 61 70 | 65 5b 31 5d 20 3d 20 28 |1] = tap|e[1] = (|
|00001be0| 63 68 61 72 20 2a 29 4e | 55 4c 4c 3b 20 2f 2a 20 |char *)N|ULL; /* |
|00001bf0| 6c 6f 63 6b 20 6f 75 74 | 20 64 65 66 61 75 6c 74 |lock out| default|
|00001c00| 20 6e 61 6d 65 73 20 2a | 2f 0a 58 09 7d 20 65 6c | names *|/.X.} el|
|00001c10| 73 65 20 7b 0a 58 09 20 | 20 20 20 28 76 6f 69 64 |se {.X. | (void|
|00001c20| 29 20 66 70 72 69 6e 74 | 66 28 73 74 64 65 72 72 |) fprint|f(stderr|
|00001c30| 2c 0a 58 09 09 09 20 20 | 22 5c 6e 25 73 3a 20 25 |,.X... |"\n%s: %|
|00001c40| 32 2e 32 73 20 2d 2d 20 | 69 6e 76 61 6c 69 64 20 |2.2s -- |invalid |
|00001c50| 6f 70 74 69 6f 6e 5c 6e | 5c 6e 22 2c 20 63 6e 61 |option\n|\n", cna|
|00001c60| 6d 65 2c 20 61 72 67 76 | 5b 31 5d 29 3b 0a 58 09 |me, argv|[1]);.X.|
|00001c70| 20 20 20 20 75 73 61 67 | 65 28 63 6e 61 6d 65 29 | usag|e(cname)|
|00001c80| 3b 0a 58 09 20 20 20 20 | 65 78 69 74 28 31 29 3b |;.X. |exit(1);|
|00001c90| 0a 58 09 7d 0a 58 20 20 | 20 20 7d 0a 58 0a 58 20 |.X.}.X | }.X.X |
|00001ca0| 20 20 20 2f 2a 20 65 72 | 61 73 65 20 74 61 70 65 | /* er|ase tape|
|00001cb0| 20 2a 2f 0a 58 20 20 20 | 20 69 66 20 28 21 73 74 | */.X | if (!st|
|00001cc0| 72 6e 63 6d 70 28 61 72 | 67 76 5b 31 5d 2c 20 22 |rncmp(ar|gv[1], "|
|00001cd0| 65 72 61 73 65 22 2c 20 | 33 29 29 7b 0a 58 09 2f |erase", |3)){.X./|
|00001ce0| 2a 20 73 65 61 72 63 68 | 20 66 6f 72 20 61 20 77 |* search| for a w|
|00001cf0| 6f 72 6b 69 6e 67 20 64 | 65 76 69 63 65 20 2a 2f |orking d|evice */|
|00001d00| 0a 58 09 66 6f 72 20 28 | 69 20 3d 20 30 3b 20 74 |.X.for (|i = 0; t|
|00001d10| 61 70 65 5b 69 5d 20 21 | 3d 20 4e 55 4c 4c 20 26 |ape[i] !|= NULL &|
|00001d20| 26 20 28 66 64 20 3d 20 | 6f 70 65 6e 28 74 61 70 |& (fd = |open(tap|
|00001d30| 65 5b 69 5d 2c 20 4f 5f | 57 52 4f 4e 4c 59 29 29 |e[i], O_|WRONLY))|
|00001d40| 20 3c 20 30 3b 20 69 2b | 2b 29 0a 58 09 09 09 3b | < 0; i+|+).X...;|
|00001d50| 0a 58 09 69 66 20 28 66 | 64 20 3c 20 30 29 20 7b |.X.if (f|d < 0) {|
|00001d60| 09 09 2f 2a 20 6f 70 65 | 6e 20 66 61 69 6c 65 64 |../* ope|n failed|
|00001d70| 2c 20 63 6f 6d 70 6c 61 | 69 6e 20 61 6e 64 20 65 |, compla|in and e|
|00001d80| 78 69 74 20 2a 2f 0a 58 | 09 20 20 20 20 28 76 6f |xit */.X|. (vo|
|00001d90| 69 64 29 20 66 70 72 69 | 6e 74 66 28 73 74 64 65 |id) fpri|ntf(stde|
|00001da0| 72 72 2c 20 6d 73 67 66 | 6d 74 2c 20 22 77 72 69 |rr, msgf|mt, "wri|
|00001db0| 74 69 6e 67 22 29 3b 0a | 58 09 20 20 20 20 28 76 |ting");.|X. (v|
|00001dc0| 6f 69 64 29 20 70 65 72 | 72 6f 72 28 22 22 29 3b |oid) per|ror("");|
|00001dd0| 0a 58 09 20 20 20 20 65 | 78 69 74 28 65 72 72 6e |.X. e|xit(errn|
|00001de0| 6f 29 3b 09 2f 2a 20 69 | 6e 20 63 61 73 65 20 61 |o);./* i|n case a|
|00001df0| 20 73 63 72 69 70 74 20 | 63 61 6e 20 75 73 65 20 | script |can use |
|00001e00| 69 74 20 2a 2f 0a 58 09 | 7d 0a 58 09 69 66 20 28 |it */.X.|}.X.if (|
|00001e10| 69 6f 63 74 6c 28 66 64 | 2c 20 57 54 51 49 43 4d |ioctl(fd|, WTQICM|
|00001e20| 44 2c 20 45 52 41 53 45 | 29 20 3c 30 29 0a 58 09 |D, ERASE|) <0).X.|
|00001e30| 09 70 65 72 72 6f 72 28 | 22 65 72 61 73 65 20 69 |.perror(|"erase i|
|00001e40| 6f 63 74 6c 20 66 61 69 | 6c 65 64 22 29 3b 0a 58 |octl fai|led");.X|
|00001e50| 0a 58 09 28 76 6f 69 64 | 29 20 63 6c 6f 73 65 28 |.X.(void|) close(|
|00001e60| 66 64 29 3b 20 20 20 20 | 2f 2a 20 69 66 20 63 6c |fd); |/* if cl|
|00001e70| 6f 73 65 20 66 61 69 6c | 73 2c 20 6e 6f 74 68 69 |ose fail|s, nothi|
|00001e80| 6e 67 20 77 65 20 63 61 | 6e 20 64 6f 20 61 62 6f |ng we ca|n do abo|
|00001e90| 75 74 20 69 74 20 2a 2f | 0a 58 20 20 20 20 7d 20 |ut it */|.X } |
|00001ea0| 2f 2a 20 65 6e 64 20 65 | 72 61 73 65 20 2a 2f 0a |/* end e|rase */.|
|00001eb0| 58 0a 58 20 20 20 20 65 | 6c 73 65 20 69 66 20 28 |X.X e|lse if (|
|00001ec0| 21 73 74 72 6e 63 6d 70 | 28 61 72 67 76 5b 31 5d |!strncmp|(argv[1]|
|00001ed0| 2c 20 22 72 65 74 65 6e | 73 22 2c 20 33 29 29 20 |, "reten|s", 3)) |
|00001ee0| 7b 09 2f 2a 20 72 65 74 | 65 6e 73 69 6f 6e 20 74 |{./* ret|ension t|
|00001ef0| 61 70 65 20 2a 2f 0a 58 | 09 66 6f 72 20 28 69 20 |ape */.X|.for (i |
|00001f00| 3d 20 30 3b 20 74 61 70 | 65 5b 69 5d 20 21 3d 20 |= 0; tap|e[i] != |
|00001f10| 4e 55 4c 4c 20 26 26 20 | 28 66 64 20 3d 20 6f 70 |NULL && |(fd = op|
|00001f20| 65 6e 28 74 61 70 65 5b | 69 5d 2c 20 4f 5f 52 44 |en(tape[|i], O_RD|
|00001f30| 4f 4e 4c 59 29 29 20 3c | 20 30 3b 20 69 2b 2b 29 |ONLY)) <| 0; i++)|
|00001f40| 0a 58 09 09 09 3b 0a 58 | 09 69 66 20 28 66 64 20 |.X...;.X|.if (fd |
|00001f50| 3c 20 30 29 20 7b 0a 58 | 09 20 20 20 20 28 76 6f |< 0) {.X|. (vo|
|00001f60| 69 64 29 20 66 70 72 69 | 6e 74 66 28 73 74 64 65 |id) fpri|ntf(stde|
|00001f70| 72 72 2c 20 6d 73 67 66 | 6d 74 2c 20 22 72 65 61 |rr, msgf|mt, "rea|
|00001f80| 64 69 6e 67 22 29 3b 0a | 58 09 20 20 20 20 28 76 |ding");.|X. (v|
|00001f90| 6f 69 64 29 20 70 65 72 | 72 6f 72 28 22 22 29 3b |oid) per|ror("");|
|00001fa0| 0a 58 09 20 20 20 20 65 | 78 69 74 28 65 72 72 6e |.X. e|xit(errn|
|00001fb0| 6f 29 3b 0a 58 09 7d 0a | 58 09 69 66 20 28 69 6f |o);.X.}.|X.if (io|
|00001fc0| 63 74 6c 28 66 64 2c 20 | 57 54 51 49 43 4d 44 2c |ctl(fd, |WTQICMD,|
|00001fd0| 20 52 45 54 45 4e 53 29 | 20 3c 20 30 29 0a 58 09 | RETENS)| < 0).X.|
|00001fe0| 09 70 65 72 72 6f 72 28 | 22 72 65 74 65 6e 73 69 |.perror(|"retensi|
|00001ff0| 6f 6e 20 69 6f 63 74 6c | 20 66 61 69 6c 65 64 22 |on ioctl| failed"|
|00002000| 29 3b 0a 58 0a 58 09 28 | 76 6f 69 64 29 20 63 6c |);.X.X.(|void) cl|
|00002010| 6f 73 65 28 66 64 29 3b | 0a 58 20 20 20 20 7d 20 |ose(fd);|.X } |
|00002020| 2f 2a 20 65 6e 64 20 72 | 65 74 65 6e 73 69 6f 6e |/* end r|etension|
|00002030| 20 2a 2f 0a 58 0a 58 20 | 20 20 20 65 6c 73 65 20 | */.X.X | else |
|00002040| 69 66 20 28 21 73 74 72 | 6e 63 6d 70 28 61 72 67 |if (!str|ncmp(arg|
|00002050| 76 5b 31 5d 2c 20 22 72 | 65 77 69 6e 64 22 2c 20 |v[1], "r|ewind", |
|00002060| 33 29 29 20 7b 09 2f 2a | 20 72 65 77 69 6e 64 20 |3)) {./*| rewind |
|00002070| 2a 2f 0a 58 09 66 6f 72 | 20 28 69 20 3d 20 30 3b |*/.X.for| (i = 0;|
|00002080| 20 74 61 70 65 5b 69 5d | 20 21 3d 20 4e 55 4c 4c | tape[i]| != NULL|
|00002090| 20 26 26 20 28 66 64 20 | 3d 20 6f 70 65 6e 28 74 | && (fd |= open(t|
|000020a0| 61 70 65 5b 69 5d 2c 20 | 4f 5f 52 44 4f 4e 4c 59 |ape[i], |O_RDONLY|
|000020b0| 29 29 20 3c 20 30 3b 20 | 69 2b 2b 29 0a 58 09 09 |)) < 0; |i++).X..|
|000020c0| 09 3b 0a 58 09 69 66 20 | 28 66 64 20 3c 20 30 29 |.;.X.if |(fd < 0)|
|000020d0| 20 7b 0a 58 09 20 20 20 | 20 28 76 6f 69 64 29 20 | {.X. | (void) |
|000020e0| 66 70 72 69 6e 74 66 28 | 73 74 64 65 72 72 2c 20 |fprintf(|stderr, |
|000020f0| 6d 73 67 66 6d 74 2c 20 | 22 72 65 61 64 69 6e 67 |msgfmt, |"reading|
|00002100| 22 29 3b 0a 58 09 20 20 | 20 20 28 76 6f 69 64 29 |");.X. | (void)|
|00002110| 20 70 65 72 72 6f 72 28 | 22 22 29 3b 0a 58 09 20 | perror(|"");.X. |
|00002120| 20 20 20 65 78 69 74 28 | 65 72 72 6e 6f 29 3b 0a | exit(|errno);.|
|00002130| 58 09 7d 0a 58 09 28 76 | 6f 69 64 29 20 63 6c 6f |X.}.X.(v|oid) clo|
|00002140| 73 65 28 66 64 29 3b 20 | 2f 2a 20 6e 6f 20 72 65 |se(fd); |/* no re|
|00002150| 77 69 6e 64 20 69 6f 63 | 74 6c 28 29 2c 20 73 6f |wind ioc|tl(), so|
|00002160| 20 66 61 6b 65 20 69 74 | 20 77 69 74 68 20 6f 70 | fake it| with op|
|00002170| 65 6e 2f 63 6c 6f 73 65 | 20 2a 2f 0a 58 20 20 20 |en/close| */.X |
|00002180| 20 7d 20 2f 2a 20 65 6e | 64 20 72 65 77 69 6e 64 | } /* en|d rewind|
|00002190| 20 2a 2f 0a 58 0a 58 20 | 20 20 20 2f 2a 20 54 68 | */.X.X | /* Th|
|000021a0| 69 73 20 6f 70 65 72 61 | 74 69 6f 6e 20 69 73 20 |is opera|tion is |
|000021b0| 66 61 6b 65 64 2c 20 73 | 6f 20 69 74 20 64 6f 65 |faked, s|o it doe|
|000021c0| 73 20 6e 6f 74 20 68 61 | 6e 64 6c 65 20 72 65 71 |s not ha|ndle req|
|000021d0| 75 65 73 74 73 0a 58 20 | 20 20 20 20 2a 20 74 6f |uests.X | * to|
|000021e0| 20 73 6b 69 70 20 6f 76 | 65 72 20 6d 6f 72 65 20 | skip ov|er more |
|000021f0| 66 69 6c 65 73 20 28 61 | 72 63 68 69 76 65 73 29 |files (a|rchives)|
|00002200| 20 74 68 61 6e 20 65 78 | 69 73 74 20 6f 6e 20 74 | than ex|ist on t|
|00002210| 68 65 20 74 61 70 65 2e | 0a 58 20 20 20 20 20 2a |he tape.|.X *|
|00002220| 20 53 74 69 6c 6c 2c 20 | 69 74 73 20 75 73 65 66 | Still, |its usef|
|00002230| 75 6c 20 74 6f 20 70 6f | 73 69 74 69 6f 6e 20 74 |ul to po|sition t|
|00002240| 68 65 20 74 61 70 65 20 | 69 66 20 6f 6e 65 20 6b |he tape |if one k|
|00002250| 6e 6f 77 73 20 74 68 65 | 20 6e 75 6d 62 65 72 0a |nows the| number.|
|00002260| 58 20 20 20 20 20 2a 20 | 6f 66 20 72 65 63 6f 72 |X * |of recor|
|00002270| 64 69 6e 67 73 20 61 72 | 65 20 6f 6e 20 74 68 65 |dings ar|e on the|
|00002280| 20 63 74 67 2e 0a 58 20 | 20 20 20 20 2a 2f 0a 58 | ctg..X | */.X|
|00002290| 0a 58 20 20 20 20 65 6c | 73 65 20 69 66 20 28 21 |.X el|se if (!|
|000022a0| 73 74 72 6e 63 6d 70 28 | 61 72 67 76 5b 31 5d 2c |strncmp(|argv[1],|
|000022b0| 20 22 66 73 66 22 2c 20 | 33 29 29 20 7b 09 2f 2a | "fsf", |3)) {./*|
|000022c0| 20 66 6f 72 77 61 72 64 | 20 73 6b 69 70 20 6f 76 | forward| skip ov|
|000022d0| 65 72 20 61 72 63 68 69 | 76 65 20 2a 2f 0a 58 09 |er archi|ve */.X.|
|000022e0| 63 6f 75 6e 74 20 3d 20 | 61 74 6f 69 28 61 72 67 |count = |atoi(arg|
|000022f0| 76 5b 32 5d 29 3b 0a 58 | 09 63 6f 75 6e 74 20 3d |v[2]);.X|.count =|
|00002300| 20 28 63 6f 75 6e 74 20 | 3d 3d 20 30 20 3f 20 31 | (count |== 0 ? 1|
|00002310| 20 3a 20 63 6f 75 6e 74 | 29 3b 0a 58 09 66 6f 72 | : count|);.X.for|
|00002320| 20 28 6a 20 3d 20 30 3b | 20 6a 20 3c 20 63 6f 75 | (j = 0;| j < cou|
|00002330| 6e 74 3b 20 6a 2b 2b 29 | 20 7b 0a 58 09 20 20 20 |nt; j++)| {.X. |
|00002340| 20 66 6f 72 20 28 69 20 | 3d 20 30 3b 20 6e 74 61 | for (i |= 0; nta|
|00002350| 70 65 5b 69 5d 20 21 3d | 20 4e 55 4c 4c 09 2f 2a |pe[i] !=| NULL./*|
|00002360| 20 73 70 6c 69 74 20 74 | 6f 20 6b 65 65 70 20 6f | split t|o keep o|
|00002370| 6e 20 73 63 72 65 65 6e | 20 2a 2f 0a 58 09 09 26 |n screen| */.X..&|
|00002380| 26 20 28 66 64 20 3d 20 | 6f 70 65 6e 28 6e 74 61 |& (fd = |open(nta|
|00002390| 70 65 5b 69 5d 2c 20 4f | 5f 52 44 4f 4e 4c 59 29 |pe[i], O|_RDONLY)|
|000023a0| 29 20 3c 20 30 3b 20 69 | 2b 2b 29 0a 58 09 09 09 |) < 0; i|++).X...|
|000023b0| 20 20 20 20 3b 0a 58 09 | 20 20 20 20 69 66 20 28 | ;.X.| if (|
|000023c0| 66 64 20 3c 20 30 29 20 | 7b 0a 58 09 09 28 76 6f |fd < 0) |{.X..(vo|
|000023d0| 69 64 29 20 66 70 72 69 | 6e 74 66 28 73 74 64 65 |id) fpri|ntf(stde|
|000023e0| 72 72 2c 20 6d 73 67 66 | 6d 74 2c 20 22 72 65 61 |rr, msgf|mt, "rea|
|000023f0| 64 69 6e 67 22 29 3b 0a | 58 09 09 28 76 6f 69 64 |ding");.|X..(void|
|00002400| 29 20 70 65 72 72 6f 72 | 28 22 22 29 3b 0a 58 09 |) perror|("");.X.|
|00002410| 09 65 78 69 74 28 65 72 | 72 6e 6f 29 3b 0a 58 09 |.exit(er|rno);.X.|
|00002420| 20 20 20 20 7d 0a 58 0a | 58 09 20 20 20 20 77 68 | }.X.|X. wh|
|00002430| 69 6c 65 28 28 72 65 73 | 75 6c 74 20 3d 20 72 65 |ile((res|ult = re|
|00002440| 61 64 28 66 64 2c 20 73 | 63 72 61 74 63 68 2c 20 |ad(fd, s|cratch, |
|00002450| 48 55 4e 4b 29 29 20 3e | 20 30 29 0a 58 09 09 09 |HUNK)) >| 0).X...|
|00002460| 20 20 20 20 3b 0a 58 0a | 58 09 20 20 20 20 69 66 | ;.X.|X. if|
|00002470| 20 28 72 65 73 75 6c 74 | 20 3c 20 30 29 20 7b 0a | (result| < 0) {.|
|00002480| 58 09 09 70 65 72 72 6f | 72 28 22 70 61 73 74 20 |X..perro|r("past |
|00002490| 45 4f 44 20 2d 20 72 65 | 77 69 6e 64 20 74 61 70 |EOD - re|wind tap|
|000024a0| 65 20 74 6f 20 75 73 65 | 22 29 3b 0a 58 09 09 65 |e to use|");.X..e|
|000024b0| 78 69 74 28 31 29 3b 0a | 58 09 20 20 20 20 7d 0a |xit(1);.|X. }.|
|000024c0| 58 09 20 20 20 20 28 76 | 6f 69 64 29 20 63 6c 6f |X. (v|oid) clo|
|000024d0| 73 65 28 66 64 29 3b 20 | 2f 2a 20 63 6c 6f 73 69 |se(fd); |/* closi|
|000024e0| 6e 67 20 74 61 70 65 20 | 6f 70 65 6e 65 64 20 61 |ng tape |opened a|
|000024f0| 73 20 6e 74 61 70 65 20 | 68 6f 6c 64 73 20 70 6f |s ntape |holds po|
|00002500| 73 69 74 69 6f 6e 20 2a | 2f 0a 58 09 7d 0a 58 20 |sition *|/.X.}.X |
|00002510| 20 20 20 7d 20 2f 2a 20 | 65 6e 64 20 66 77 64 20 | } /* |end fwd |
|00002520| 73 6b 69 70 20 66 69 6c | 65 20 2a 2f 0a 58 0a 58 |skip fil|e */.X.X|
|00002530| 20 20 20 20 65 6c 73 65 | 20 7b 20 20 2f 2a 20 75 | else| { /* u|
|00002540| 6e 72 65 63 6f 67 6e 69 | 7a 65 64 20 63 6d 64 20 |nrecogni|zed cmd |
|00002550| 2a 2f 0a 58 09 75 73 61 | 67 65 28 63 6e 61 6d 65 |*/.X.usa|ge(cname|
|00002560| 29 3b 09 2f 2a 20 74 65 | 6c 6c 20 75 73 65 72 20 |);./* te|ll user |
|00002570| 68 6f 77 20 74 6f 20 75 | 73 65 20 74 68 69 73 20 |how to u|se this |
|00002580| 74 68 69 6e 67 20 2a 2f | 0a 58 09 65 78 69 74 28 |thing */|.X.exit(|
|00002590| 31 29 3b 09 2f 2a 20 67 | 69 76 65 20 61 20 66 61 |1);./* g|ive a fa|
|000025a0| 69 6c 65 64 20 65 78 69 | 74 20 2a 2f 0a 58 20 20 |iled exi|t */.X |
|000025b0| 20 20 7d 0a 58 20 20 20 | 20 65 78 69 74 28 30 29 | }.X | exit(0)|
|000025c0| 3b 0a 58 20 20 20 20 2f | 2a 4e 4f 54 52 45 41 43 |;.X /|*NOTREAC|
|000025d0| 48 45 44 2a 2f 0a 58 7d | 0a 58 0a 76 6f 69 64 20 |HED*/.X}|.X.void |
|000025e0| 75 73 61 67 65 28 63 6e | 61 6d 65 29 0a 63 68 61 |usage(cn|ame).cha|
|000025f0| 72 20 2a 63 6e 61 6d 65 | 3b 0a 58 7b 0a 58 20 20 |r *cname|;.X{.X |
|00002600| 20 20 0a 58 20 20 20 20 | 2f 2a 20 76 6f 69 64 20 | .X |/* void |
|00002610| 63 61 73 74 73 20 61 72 | 65 20 74 6f 20 6d 61 6b |casts ar|e to mak|
|00002620| 65 20 6c 69 6e 74 20 73 | 68 75 74 20 75 70 20 2a |e lint s|hut up *|
|00002630| 2f 0a 58 20 20 20 20 28 | 76 6f 69 64 29 20 66 70 |/.X (|void) fp|
|00002640| 72 69 6e 74 66 28 73 74 | 64 65 72 72 2c 20 22 43 |rintf(st|derr, "C|
|00002650| 6f 6d 6d 61 6e 64 20 75 | 74 69 6c 69 74 79 20 66 |ommand u|tility f|
|00002660| 6f 72 20 57 61 6e 67 74 | 65 6b 20 63 74 67 20 64 |or Wangt|ek ctg d|
|00002670| 72 69 76 65 73 2e 5c 6e | 22 29 3b 0a 58 20 20 20 |rives.\n|");.X |
|00002680| 20 28 76 6f 69 64 29 20 | 66 70 72 69 6e 74 66 28 | (void) |fprintf(|
|00002690| 73 74 64 65 72 72 2c 20 | 22 55 73 61 67 65 3a 20 |stderr, |"Usage: |
|000026a0| 25 73 20 5b 2d 66 20 64 | 65 76 69 63 65 5d 20 63 |%s [-f d|evice] c|
|000026b0| 6f 6d 6d 61 6e 64 20 5c | 6e 22 2c 20 63 6e 61 6d |ommand \|n", cnam|
|000026c0| 65 29 3b 0a 58 20 20 20 | 20 28 76 6f 69 64 29 20 |e);.X | (void) |
|000026d0| 66 70 72 69 6e 74 66 28 | 73 74 64 65 72 72 2c 20 |fprintf(|stderr, |
|000026e0| 22 63 6f 6d 6d 61 6e 64 | 20 69 73 20 6f 6e 65 20 |"command| is one |
|000026f0| 6f 66 3a 5c 6e 22 29 3b | 0a 58 20 20 20 20 28 76 |of:\n");|.X (v|
|00002700| 6f 69 64 29 20 66 70 72 | 69 6e 74 66 28 73 74 64 |oid) fpr|intf(std|
|00002710| 65 72 72 2c 20 22 20 20 | 20 20 65 72 61 73 65 20 |err, " | erase |
|00002720| 2d 20 65 72 61 73 65 20 | 74 61 70 65 5c 6e 22 29 |- erase |tape\n")|
|00002730| 3b 0a 58 20 20 20 20 28 | 76 6f 69 64 29 20 66 70 |;.X (|void) fp|
|00002740| 72 69 6e 74 66 28 73 74 | 64 65 72 72 2c 20 22 20 |rintf(st|derr, " |
|00002750| 20 20 20 72 65 74 65 6e | 73 20 2d 20 72 65 74 65 | reten|s - rete|
|00002760| 6e 73 69 6f 6e 20 74 61 | 70 65 20 5c 6e 22 29 3b |nsion ta|pe \n");|
|00002770| 0a 58 20 20 20 20 28 76 | 6f 69 64 29 20 66 70 72 |.X (v|oid) fpr|
|00002780| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 20 22 20 20 |intf(std|err, " |
|00002790| 20 20 72 65 77 69 6e 64 | 20 2d 20 72 65 77 69 6e | rewind| - rewin|
|000027a0| 64 20 61 20 74 61 70 65 | 20 6c 65 66 74 20 75 6e |d a tape| left un|
|000027b0| 77 6f 75 6e 64 5c 6e 22 | 29 3b 0a 58 20 20 20 20 |wound\n"|);.X |
|000027c0| 28 76 6f 69 64 29 20 66 | 70 72 69 6e 74 66 28 73 |(void) f|printf(s|
|000027d0| 74 64 65 72 72 2c 20 22 | 20 20 20 20 66 73 66 20 |tderr, "| fsf |
|000027e0| 5b 6e 5d 20 2d 20 73 6b | 69 70 20 6f 76 65 72 20 |[n] - sk|ip over |
|000027f0| 66 69 6c 65 20 6f 72 20 | 61 72 63 68 69 76 65 20 |file or |archive |
|00002800| 6f 6e 20 74 61 70 65 5c | 6e 22 29 3b 0a 58 20 20 |on tape\|n");.X |
|00002810| 20 20 28 76 6f 69 64 29 | 20 66 70 72 69 6e 74 66 | (void)| fprintf|
|00002820| 28 73 74 64 65 72 72 2c | 20 22 69 66 20 61 6e 20 |(stderr,| "if an |
|00002830| 6f 70 65 6e 20 66 61 69 | 6c 73 2c 20 77 74 20 74 |open fai|ls, wt t|
|00002840| 72 69 65 73 20 6f 74 68 | 65 72 20 6e 61 6d 65 73 |ries oth|er names|
|00002850| 20 66 6f 72 20 22 29 3b | 0a 58 20 20 20 20 28 76 | for ");|.X (v|
|00002860| 6f 69 64 29 20 66 70 72 | 69 6e 74 66 28 73 74 64 |oid) fpr|intf(std|
|00002870| 65 72 72 2c 20 22 74 68 | 65 20 74 61 70 65 20 64 |err, "th|e tape d|
|00002880| 65 76 69 63 65 2c 5c 6e | 69 6e 20 63 61 73 65 20 |evice,\n|in case |
|00002890| 61 20 6e 6f 64 65 20 77 | 61 73 6e 27 74 22 29 3b |a node w|asn't");|
|000028a0| 0a 58 20 20 20 20 28 76 | 6f 69 64 29 20 66 70 72 |.X (v|oid) fpr|
|000028b0| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 20 22 63 72 |intf(std|err, "cr|
|000028c0| 65 61 74 65 64 2c 20 6f | 72 20 77 61 73 20 72 65 |eated, o|r was re|
|000028d0| 6d 6f 76 65 64 2e 20 20 | 49 66 20 61 20 6e 61 6d |moved. |If a nam|
|000028e0| 65 20 69 73 20 67 69 76 | 65 6e 20 62 79 5c 6e 22 |e is giv|en by\n"|
|000028f0| 29 3b 0a 58 20 20 20 20 | 28 76 6f 69 64 29 20 66 |);.X |(void) f|
|00002900| 70 72 69 6e 74 66 28 73 | 74 64 65 72 72 2c 20 22 |printf(s|tderr, "|
|00002910| 74 68 65 20 2d 66 20 6f | 70 74 69 6f 6e 2c 20 6f |the -f o|ption, o|
|00002920| 6e 6c 79 20 74 68 61 74 | 20 6e 61 6d 65 20 77 69 |nly that| name wi|
|00002930| 6c 6c 20 62 65 20 74 72 | 69 65 64 2e 5c 6e 22 29 |ll be tr|ied.\n")|
|00002940| 3b 0a 58 7d 0a 45 4e 44 | 5f 4f 46 5f 46 49 4c 45 |;.X}.END|_OF_FILE|
|00002950| 0a 69 66 20 74 65 73 74 | 20 35 36 30 30 20 2d 6e |.if test| 5600 -n|
|00002960| 65 20 60 77 63 20 2d 63 | 20 3c 27 77 74 2e 63 27 |e `wc -c| <'wt.c'|
|00002970| 60 3b 20 74 68 65 6e 0a | 20 20 20 20 65 63 68 6f |`; then.| echo|
|00002980| 20 73 68 61 72 3a 20 5c | 22 27 77 74 2e 63 27 5c | shar: \|"'wt.c'\|
|00002990| 22 20 75 6e 70 61 63 6b | 65 64 20 77 69 74 68 20 |" unpack|ed with |
|000029a0| 77 72 6f 6e 67 20 73 69 | 7a 65 21 0a 66 69 0a 23 |wrong si|ze!.fi.#|
|000029b0| 20 65 6e 64 20 6f 66 20 | 27 77 74 2e 63 27 0a 66 | end of |'wt.c'.f|
|000029c0| 69 0a 65 63 68 6f 20 73 | 68 61 72 3a 20 45 6e 64 |i.echo s|har: End|
|000029d0| 20 6f 66 20 73 68 65 6c | 6c 20 61 72 63 68 69 76 | of shel|l archiv|
|000029e0| 65 2e 0a 65 78 69 74 20 | 30 0a 2d 2d 20 0a 70 61 |e..exit |0.-- .pa|
|000029f0| 74 40 72 77 69 6e 67 20 | 20 20 20 20 20 20 20 20 |t@rwing | |
|00002a00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002a10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 28 50 | | (P|
|00002a20| 61 74 20 4d 79 72 74 6f | 29 2c 20 20 53 65 61 74 |at Myrto|), Seat|
|00002a30| 74 6c 65 2c 20 57 41 0a | 20 20 20 20 20 20 20 20 |tle, WA.| |
|00002a40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002a50| 20 20 20 20 2e 2e 2e 21 | 75 75 6e 65 74 21 70 69 | ...!|uunet!pi|
|00002a60| 6c 63 68 75 63 6b 21 72 | 77 69 6e 67 21 70 61 74 |lchuck!r|wing!pat|
|00002a70| 0a 20 20 20 20 20 20 2e | 2e 2e 21 75 77 2d 62 65 |. .|..!uw-be|
|00002a80| 61 76 65 72 21 75 77 2d | 65 6e 74 72 6f 70 79 21 |aver!uw-|entropy!|
|00002a90| 64 61 74 61 69 6f 21 2f | 0a 57 49 53 44 4f 4d 3a |dataio!/|.WISDOM:|
|00002aa0| 20 20 20 20 22 54 72 61 | 76 65 6c 6c 69 6e 67 20 | "Tra|velling |
|00002ab0| 75 6e 61 72 6d 65 64 20 | 69 73 20 6c 69 6b 65 20 |unarmed |is like |
|00002ac0| 62 6f 61 74 69 6e 67 20 | 77 69 74 68 6f 75 74 20 |boating |without |
|00002ad0| 61 20 6c 69 66 65 20 6a | 61 63 6b 65 74 22 20 0a |a life j|acket" .|
+--------+-------------------------+-------------------------+--------+--------+