Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!snorkelwacker!ira.uka.de!smurf!gopnbg!tmpmbx!einoed!geminix!gemini From: gemini@geminix.UUCP (Uwe Doering) Newsgroups: comp.unix.i386 Subject: Re: wangtek retensioning problems Message-ID: Date: 4 Feb 90 17:47:38 GMT References: <292@comcon.UUCP> Reply-To: gemini@netmbx.UUCP Organization: Private UNIX Site Lines: 84 tim@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 #include #include 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 #include #include 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@netmbx.UUCP Berlin |--------------------------------------------------------------- West Germany | Bangpath : ...!uunet!unido!tmpmbx!netmbx!gemini