Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!rbj@icst-cmr.arpa From: rbj@icst-cmr.arpa (Root Boy Jim) Newsgroups: comp.unix.wizards Subject: KSH portability Message-ID: <13982@brl-adm.ARPA> Date: 9 May 88 17:20:25 GMT Sender: news@brl-adm.ARPA Lines: 38 From: Doug GwynThe 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. Well, it's probably too late in the game for another suggestion (I knew I should have joined that committee...), but... What is really needed is an fd to fp table, maintained by stdio, so that: for (fd = 0; fd < MAXFD; fd ++) fp = fdtofp[fd] && fflush(fp); Anything weird about this idea? If your need to peek at the FILE implementation differs from this, I'm curious to hear what it is. Can't think of anything right now, but my idea is not really peeking, it's just handle translation. (Root Boy) Jim Cottrell National Bureau of Standards Flamer's Hotline: (301) 975-5688 The opinions expressed are solely my own and do not reflect NBS policy or agreement I HAVE to buy a new ``DODGE MISER'' and two dozen JORDACHE JEANS because my viewscreen is ``USER-FRIENDLY''!!