Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!hpfcdc!paulp From: paulp@hpfcdc.HP.COM (Paul Perlmutter) Newsgroups: comp.sys.hp Subject: Re: Reading past end-of-tape mark on cartridge tape? Message-ID: <5570382@hpfcdc.HP.COM> Date: 1 Mar 90 21:30:52 GMT References: <483@limbo.Intuitive.Com> Organization: HP Ft. Collins, Co. Lines: 53 I have a couple of questions: - What does the kernel message buffer indicate. If it is reading and EOF, then the driver will log this in the buffer. - If it is an EOF mark, what is it doing there, and how do want to copy it? (e.g. skip it, or reproduce it on the disk as a block of all 0's?) Two options in any case are available, each with tradeoffs: (assuming it is a tape mark) (1) use 'tcio' - this can be achieved with an option: -f n where n indicates number of tape marks to skip. Thus, by clever repeated use of 'tcio', you can read the entire tape. (2) write your own program: this is perhaps the more time consuming, but at least you'll have control of what's going on. Essentially, you will copy the tape - even on error, copying a block of zeroes when an error or tape mark is encountered. Here is the critical loop: char zerobuf[1K]; main() { char *ptr, buf[1K]; for (i=0; i % tcio -ivZ /dev/rct > tape size: 65408 blocks > tcio(1009): 1024 byte blocks read: 96 A tape (hard) error may be causing the tape to bomb out too! Cheers, Paul Perlmutter