From owner-freebsd-scsi Thu Dec 25 23:06:42 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id XAA27237 for freebsd-scsi-outgoing; Thu, 25 Dec 1997 23:06:42 -0800 (PST) (envelope-from owner-freebsd-scsi) Received: from revolution.3-cities.com (root@revolution.3-cities.com [204.203.224.155]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id XAA27229 for ; Thu, 25 Dec 1997 23:06:39 -0800 (PST) (envelope-from msmith@3-cities.com) Received: from mark (bigtca513.3-cities.com [204.203.228.174]) by revolution.3-cities.com (8.8.5/8.7.3) with SMTP id XAA21889 for ; Thu, 25 Dec 1997 23:01:44 -0800 (PST) Message-ID: <34A3530D.590@3-cities.com> Date: Thu, 25 Dec 1997 22:47:41 -0800 From: Mark Smith Reply-To: msmith@3-cities.com Organization: Organization? What's that?!? X-Mailer: Mozilla 3.03Gold (Win95; U) MIME-Version: 1.0 To: freebsd-scsi@freebsd.org Subject: DAT question/problem! Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-scsi@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Greetings, I'm currently trying to write a program that verifies DAT tapes for recycling in the tape pool. How do you detect the end of the tape? I use open() to open the device, ioctl to rewind it and MTIOCGET to get the device information. mtget.mt_type reports a type 7 tape device which is a sun, this is a Python (see /var/log/message snip later). OK, I then do a write(mt,buff,size) in a loop to write the block pattern out. I then receive a write=-1 and errno = 5 (Input Output error). Is this how it should be?? Dec 25 01:35:01 mark /kernel: ncr0 rev 17 int a irq 9 on pci0:11 Dec 25 01:35:01 mark /kernel: ncr0 waiting for scsi devices to settle Dec 25 01:35:01 mark /kernel: (ncr0:1:0): "ARCHIVE Python 25588-XXX 2.96" type 1 removable SCSI 2 Dec 25 01:35:01 mark /kernel: st0(ncr0:1:0): Sequential-Access Dec 25 01:35:01 mark /kernel: st0(ncr0:1:0): asynchronous. Dec 25 01:35:01 mark /kernel: st0(ncr0:1:0): M_REJECT received (1:8). Dec 25 01:35:01 mark /kernel: density code 0x0, variable blocks, write-enabled Thanks! Mark