Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: When to use fflush()? Keywords: fflush Message-ID: <10913@smoke.BRL.MIL> Date: 2 Sep 89 23:04:06 GMT References: <143@sherpa.uucp> <10882@smoke.BRL.MIL> <14507@haddock.ima.isc.com> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 16 In article <14507@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes: >I've forgotten whether this issue was ever resolved: what should happen if the >output stream is a VMS record-oriented file? If the currently buffered output >contains no newlines, is it appropriate for fflush() to do nothing, and return >success? The specification says that unwritten data IS delivered to the host environment. It does not (and cannot) be specific about how that is actually accomplished. Section 4.9.3 of the pANS describes buffering matters using the phrase "intended to", in acknowledgement of the fact that host environments vary widely in this regard. I would think that so long as the implementation ensures that the data will reach the record-structured file SOMEtime, that would suffice. Certainly on a terminal, though, the flush should cause the unwritten characters to immediately be sent to the terminal.