mag tape control

utzoo!duke!decvax!ucbvax!Szurko at UDel utzoo!duke!decvax!ucbvax!Szurko at UDel
Fri May 22 14:49:49 AEST 1981


	we've had the following set around here for about 3-4 years and they
seem to be all that's needed.  we have drives that have to be manually
switched for 800/1600 so you might want to add a control to do it
programatically for drives that have the capability.

	Code         Argument            Meaning

	MTWEOF       none                write an eof mark at the current
					 tape pos.

	MTSKIP       <# of tape recs>    skip the indicated number of tape 
					 records.  a positive value means
					 forward, negative means backwards.

	MTREWIND     none                rewind tape

	MTUNLOAD     none                unload tape

There's also a way to turn off rewind and/or eof writing on close besides
the different minor device number hack.

It's also very important to have a defined set of error codes.  we use the
following set (this is not complete):

	Code            Meaning

	EMTEOF          encountered an eof mark during read, write or skip
	EMTEOT          encountered end of tape during read, write or skip
	EMTBOT		encountered beginning of tape (on reverse skips)
	EMTBAD		'bad tape' error

i'm think there are others, but i'm not sure off-hand.  you can see that
using this set of control primitives and error codes, it's a simple
matter to write user level routines which skip files and position
the tape between the final two eof marks on a reel, etc.

	unix has terrible mag tape handling (so what else is new, right?)
given the above functionality in raw interface, there is really no need
for the block interface as far as i can see.  consequently, we don't
use it (except in 'tp').

	this isn't really a very complete presentation, but it gives
a good idea of what we have.  i would argue for a minimum set of control
primitives keeping most of the fancy stuff in user code.

ed





More information about the Comp.unix.wizards mailing list