Path: utzoo!attcan!uunet!cs.utexas.edu!sun-barr!apple!bloom-beacon!mit-eddie!apollo!nazgul From: nazgul@apollo.COM (Kee Hinckley) Newsgroups: comp.sys.apollo Subject: Re: More on STDIN and EOF & Redirection Message-ID: <432facc0.1b147@apollo.COM> Date: 13 May 89 00:03:00 GMT References: <8905041532.AA06381@umix.cc.umich.edu> Reply-To: nazgul@apollo.COM (Kee Hinckley) Organization: Apollo Computer, Chelmsford, MA Lines: 24 In article <8905041532.AA06381@umix.cc.umich.edu> FERGUSON@TMASL.EXXON.COM writes: > >A minute ago, I asked if there was a way to change input redirection >on the fly from within a program. > >Is there a way to use stream_$errin? What is error input? Where does >it come from? I tried an ios_$get on stream_$errin, and it told me >that no data was available on that stream. > stream_$errin was a very nice concept which would have done exactly what you want. Unfortunately the SVID requires that when a program starts and opens a file, the file id must equal 3, (in other words, you must only have three streams open, and stream_$errin made 4). At SR10 we made it work such that OBJ files still got four streams, but COFF objects only got 3. Over time that hack will go away and all programs will only have the 3 standard streams. All is not lost however. You can have your program open the device /dev/tty and it will do what you want when you read and write to it. The main disadvantage to this is to the user, since they can't bypass whatever you were doing and redirect /dev/tty like they could with errin. -kee