wangtek retensioning problems

Uwe Doering gemini at geminix.UUCP
Mon Feb 5 04:47:38 AEST 1990


tim at comcon.UUCP (Tim Brown) writes:

>Ok, I give up!  Does anyone know how to write a tape command to retension
>, rewind and erase etc for a wangtek tape drive running under ISC2.0.2?
>I have written some ioctl calls but I am obviously missing something on
>thsi one.  I can't figure out which include file to use, the wtioctl.h
>file is about four lines long and those calls don't seem to work.  Can
>someone help?  I really need this, I have several tapes that won't work
>at all.

I've had the same problem recently. Rewinding should work automatically
before and after the tape is actually used (at least I think so).

For erasing and retensioning tapes I wrote two simple programs that should
do the trick. I've tested them with the Wangtek 150 MB streamer model.
I've named them `wterase' and `wtretens'. Here they are:

------------------------- cut here -------------------------
/* Erase command for Wangtek streamer driver (386/ix 2.0.2) */

#include <stdio.h>
#include <fcntl.h>
#include <sys/wtioctl.h>

main()
{
	int fildes;

	if ((fildes = open("/dev/tape", O_WRONLY | O_NDELAY)) == -1)
	{
		perror("wterase: can't open /dev/tape");
		exit(2);
	}

	if (ioctl(fildes, WTQICMD, ERASE) == -1)
	{
		perror("wterase: error on ioctl call");
		exit(2);
	}

	if (close(fildes) == -1)
	{
		perror("wterase: can't close /dev/tape");
		exit(2);
	}

	exit(0);
}
------------------------- cut here -------------------------
/* Retension command for Wangtek streamer driver (386/ix 2.0.2) */

#include <stdio.h>
#include <fcntl.h>
#include <sys/wtioctl.h>

main()
{
	int fildes;

	if ((fildes = open("/dev/tape", O_RDONLY)) == -1)
	{
		perror("wtretens: can't open /dev/tape");
		exit(2);
	}

	if (ioctl(fildes, WTQICMD, RETENS) == -1)
	{
		perror("wtretens: error on ioctl call");
		exit(2);
	}

	if (close(fildes) == -1)
	{
		perror("wtretens: can't close /dev/tape");
		exit(2);
	}

	exit(0);
}
------------------------- cut here -------------------------
-- 
Uwe Doering   |  Domain   : gemini at netmbx.UUCP
Berlin        |---------------------------------------------------------------
West Germany  |  Bangpath : ...!uunet!unido!tmpmbx!netmbx!gemini



More information about the Comp.unix.i386 mailing list