[comp.unix.questions] 1/2 inch tape problem

SPETTRI%IFIIDG.BITNET@icnucevm.cnuce.cnr. (Mencaraglia Francesco) (12/16/88)

The problem : i have to write data on a 1/2 inch tape drive ; I do it asyncro-
nously using ioctl(2) with FIOAWRITE but it is not clear what happens when I
have filled the tape ( that is I have reached the eot marker ) ; on other os
(RSX, VMS) I can check the status word to know when i have to switch tape.
The same possibility is surely built in the Unix as when i dump to tape and
the first tape is full i am prompted for another one (unfortunately i do not
have the source to check how this is done).
The question : how do I check for eot ? should I use a second ioctl call with
the MTIOCGET parameter (BTW this parameter as well MTIOCTOP is quoted under
mt(4) but there are not many details ) ? or ioctl is good enough to consider
writing after eot an error and so it returns -1 and sets errno ? or should I
only evaluate how many records fit on the tape and switch after the number is
reached without any eot check ?
Any help is welcome as I am really in big trouble ? Please e-mail answers as
I am not a current subscriber to the list, but if I receive enough information
I will be glad to post a summary. I am cross-posting this also to other lists.

                                 Francesco

 spettri@ifiidg      bitnet address