Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.unix-wizards,net.periphs Subject: seek on raw magtape Message-ID: <6267@utzoo.UUCP> Date: Sat, 4-Jan-86 21:13:12 EST Article-I.D.: utzoo.6267 Posted: Sat Jan 4 21:13:12 1986 Date-Received: Sat, 4-Jan-86 21:13:12 EST Organization: U of Toronto Zoology Lines: 25 The major reason why tar is generally unwilling to add to a blocked tape is the inability to (portably!) seek the tape backwards to rewrite the last block of the previous contents. The major reason for this inability is that the "skip" primitives of tape systems seldom let you specify a skip in bytes, or tell you how many bytes they have skipped -- they tend to work in blocks only. Contemplating this, an idea came. Given this uncooperative behavior of the hardware, the general seek-on-raw-magtape problem is intractable. But most tapes that one would be interested in seeking on, notably tar tapes, have a very simple structure. They usually have at most two block sizes, a main size plus perhaps a shorter one for the last block. On a tape like this, limited seeks are possible even with the usual hardware. Specifically, on any tape one could seek to any block boundary within the region of tape already traversed by reads or writes, by having the driver remember the pattern of block sizes seen in those operations. And on the usual tapes, the pattern is very simple. The storage and bookkeeping effort needed to remember it would be small. Probably best would be to remember the pattern since the last tape mark, which would let one use seeks within one file on a multi-file tape. Can anyone see any holes in this? -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry