[comp.periphs.scsi] status needed from SCSI tape devices

cpl@ednor.bbc.com (Chuck Lambros) (07/03/90)

I am working on a C program to manipulate (read and write) tapes which
requires knowledge of the following:

o	when a tape is at BOT,
o	when a tape is a EOT.

I am mostly interest in optaining a method for SCSI tape devices.

It is essential to have this information because special header records
are written at the beginning-of-tape, and special trailer records
are written before the end-of-tape.

Here is some background:

The tapes that I am reading do not necessary follow normal conventions
where two consecutive filemarks indicate end-of-tape.  It is possible
that these marks will be written beyond the photoreflective EOT marker
tape.  Since most Unix systems do not allow you to safely read beyond
the photoreflective EOT marker,  I must have a method of detecting
this marker.

The present version of my program has been developed using Berkley
4.2 Unix.  I am using the 'ioctl' function to obtain tape
status information.  On most Unix systems, passing ioctl the MTIOCGET
option will fill the tape device status in the mt_dsreg field of
the mtget structure supplied.  The information returned in this
field is GROSSLY hardware specific.

The information passed back in the mtget structure does not seem to be
useful when attempting to determine of a SCSI tape device.  Since most
Unix applications do not need this information, I have found that most
device drivers to not even fill this field when a tape status is
requested.

If anyone out there has any experience or ideas of how to find out
the status of a SCSI tape drive, would you please help out a frustrated
programmer?

Please email any info, and thanks in advance.


-- 
Chuck Lambros                                   Boston Business Computing, Ltd.
cpl@ednor.bbc.com