Xref: utzoo comp.unix.questions:6890 comp.unix.wizards:8301 Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: KSH portability Message-ID: <7847@brl-smoke.ARPA> Date: 6 May 88 19:00:36 GMT References: <295@cmtl01.UUCP> <12142@tut.cis.ohio-state.edu> <631@vsi.UUCP> <4063@mtgzz.UUCP> <52159@sun.uucp> <5146@bloom-beacon.MIT.EDU> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 25 In article <5146@bloom-beacon.MIT.EDU> wolfgang@mgm.mit.edu (Wolfgang Rupprecht) writes: >What *is* the "approved" method of finding all _iob's? There isn't one. This is an extremely implementation-dependent matter, subject to change even between C releases for the same system. The point of using facilities to to encapsulate I/O streams as an abstract data type. If you really need to do something not supported by the standard interface, you should either avoid using facilities or else work to get the standard interface extended to provide whatever it is that you really need to do. The last example of this that I know of is an extension of fflush() so that a NULL argument indicates a request to flush all open output streams. I got this adopted into the proposed ANSI C standard as probably the last "invention" to make it into the standard (although I proposed it over a year ago, it got overlooked until last meeting). Buffer flushing before a fork() has been the only time I have needed to cheat on the standard interface, and with this change to fflush() EVENTUALLY that cheat won't be necessary. Of course it will be a while before I can rely on fflush() supporting this new feature, so there will be an #if __STDC__ in the rare places where I need this capability. If your need to peek at the FILE implementation differs from this, I'm curious to hear what it is.