Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!execu!sequoia!keith From: keith@sequoia.UUCP (Keith Pyle) Newsgroups: comp.unix.ultrix Subject: Tape EOF processing Keywords: read EOF tape failure Message-ID: <490@sequoia.UUCP> Date: 3 May 89 20:37:03 GMT Organization: The Domain of the Toad King Lines: 28 I have encountered the following problem under Ultrix-32 V3.0 (Rev 64): when reading from a tape (either TK50 or TK70, I haven't checked 9 track), the end of file processing is incorrect. Quoting from TFM for mtio(4): > A zero byte count is returned > when a tape mark is read, but another read will fetch the > first record of the next tape file. What I have found is that when an EOF is encountered, all subsequent calls to read(2) will return 0. The only way to clear this condition that I have found thus far is to close(2) the file and open(2) it again. (This assumes the use of the no-rewind device.) The exact same code functions as expected and as per the documentation under SunOS 4.0.1 and Sequent's DYNIX V3.0.12. Is this a known problem with Ultrix? Is there a peculiar, strange, or warped reason for this behavior (other than "It's a bug")? If not a bug, is there a method, other than the one I've discovered, to clear the condition to permit the next read(2) to succeed as the manual says it should in the first place? Are we having fun yet? -- ----------------------------------------------------------------------------- Keith Pyle ...!cs.utexas.edu!execu!keith Execucom Systems Corp., Austin, Texas Disclaimer: What?? You actually believed me? -----------------------------------------------------------------------------