Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!rutgers!uwvax!persoft!gorgon!dag From: dag@gorgon.uucp (Daniel A. Glasser) Newsgroups: comp.unix.sysv386 Subject: Retensioning tapes through wt(7) under ISC 3.2.2.1 Summary: Not enough information to go on. Keywords: wt(7), QIC-60, retensioning, tape Message-ID: <1991Apr21.174450.26570@gorgon.uucp> Date: 21 Apr 91 17:44:50 GMT Sender: dag@gorgon.uucp (Daniel A. Glasser) Organization: Perseus Reductions (Medusa Division) Lines: 78 This is touched on in the FAQ posting, but I've run into a bit of a snag; I have a 60 meg tape drive (TECMAR QT-60i) connected to a Wangtek PC-60 controller, and it works just fine with the ISC WT driver. I have been retensioning my tapes by booting DOS from a floppy and using the utilities that came with the drive. I would like to do it without rebooting my machine. I've been trying to write a retension utility that uses the wt(7)'s documented RETENS command to ioctl(), but seem to be missing something. None of the documentation that came with my system says anything more about this command to the wt driver beyond the name of the symbol and that it's supposed to tell the device driver to retension the tape. Nothing about what other arguments I might need. I wrote the program included below to do this, and discovered that I always get an 'invalid argument' error back from the ioctl(). If I open /dev/tape, the tape moves a bit but does not retension. If I open /dev/ntape (no-rewind) the tape drive seems to go into eternal retensioning. I ran the old /dev/tape version to get it to stop. What's the real scoop on this ioctl() for the wt driver? Does anyone have a program to do the retensioning that works and that they are willing to share with me? Is more information available on the wt(7) ioctl()s? Please reply via e-mail as I don't always get all the news (space problems) and can't always read all of what I do get. Thanks. [.signature is at end] Daniel A. Glasser dag%gorgon@persoft.com -or- dag@persoft.com -or- ...!uwvax!persoft!gorgon!dag -or- ...!uwvax!persoft!dag ----- Beginning of program ---- #include #include #include #include #ifndef NOREWIND #define TAPE_DEVICE "/dev/tape" #else #define TAPE_DEVICE "/dev/ntape" #endif main() { int status; int tapefd; extern int errno; /* Open the tape drive. This appears to be okay */ tapefd = open(TAPE_DEVICE, O_RDONLY); if (tapefd < 0) { perror("retens"); exit(1); } errno = 0; /* Reset errno... */ /* Try to retension the tape. */ status = ioctl(tapefd, RETENS, 0); if (status < 0) perror("retens"); /* On failure, tell all. */ /* print out the status */ printf("Status on retension was %d\n", status); /* close the drive now. */ close(tapefd); /* leave the program. */ exit(0); } ---- end of program ----- -- Daniel A. Glasser One of those things that goes dag%gorgon@persoft.com "BUMP! (ouch!)" in the night.