Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: fflush |
| Date | 2011-09-06 10:51 -0700 |
| Organization | None to speak of |
| Message-ID | <lnty8ppnjr.fsf@nuthaus.mib.org> (permalink) |
| References | <4e5fe3b1$0$27973$bbae4d71@news.suddenlink.net> <w4KdnWM2SZE4D_zTnZ2dnUVZ_uednZ2d@posted.internetamerica> <lnfwkdqwej.fsf@nuthaus.mib.org> <x9ydnTa62KUb0vvTnZ2dnUVZ_gudnZ2d@bestweb.net> |
Kenneth Brody <kenbrody@spamcop.net> writes:
> On 9/3/2011 3:05 PM, Keith Thompson wrote:
>> gordonb.o3gsp@burditt.org (Gordon Burditt) writes:
>> [...]
>>> Do not call fflush() on input files or stdin. Forcing the user to
>>> untype input is a safety hazard, especially if the user is not at
>>> the keyboard and is driving or asleep. There's also a remote chance
>>> it could damage the file. fflush() does not mean "take the characters
>>> in the buffer and *discard* them". It means "take the characters in
>>> the buffer and put them in the file."
>>
>> fflush() on an input file doesn't mean *anything*.
>
> Nit: Some implementations define it to mean "discard anything already read
> do to buffered I/O.
Yes.
> But, as far as the C language itself is concerned, you are correct that it
> doesn't mean anything. In fact, it's a bit more than "doesn't mean
> anything", as it's actually defined as being "undefined" (7.19.5.2p2).
Which is exactly equivalent to not being defined at all (4p2).
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
fflush "Bill Cunningham" <nospam@nspam.invalid> - 2011-09-01 15:57 -0400
Re: fflush Willem <willem@toad.stack.nl> - 2011-09-01 20:09 +0000
Re: fflush John Gordon <gordon@panix.com> - 2011-09-01 20:23 +0000
Re: fflush sandeep <nospam@nospam.com> - 2011-09-01 20:49 +0000
Re: fflush Kenneth Brody <kenbrody@spamcop.net> - 2011-09-02 10:59 -0400
Re: fflush Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-01 22:06 +0000
Re: fflush Kenneth Brody <kenbrody@spamcop.net> - 2011-09-02 11:05 -0400
Re: fflush Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-09-02 17:04 +0000
Re: fflush Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-09-01 14:55 -0600
Re: fflush pete <pfiland@mindspring.com> - 2011-09-01 19:14 -0400
Re: fflush Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-09-01 17:27 -0600
Re: fflush pete <pfiland@mindspring.com> - 2011-09-01 19:33 -0400
Re: fflush Seebs <usenet-nospam@seebs.net> - 2011-09-02 01:36 +0000
Re: fflush Kenneth Brody <kenbrody@spamcop.net> - 2011-09-02 11:08 -0400
Re: fflush Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-09-02 09:35 -0600
Re: fflush Nobody <nobody@nowhere.com> - 2011-09-03 07:24 +0100
Re: fflush gordonb.47ba6@burditt.org (Gordon Burditt) - 2011-09-02 21:42 -0500
Re: fflush Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-09-02 21:01 -0600
Re: fflush Nobody <nobody@nowhere.com> - 2011-09-02 00:34 +0100
Re: fflush mathog <dmathog@gmail.com> - 2011-09-02 09:57 -0700
Re: fflush David Thompson <dave.thompson2@verizon.net> - 2011-09-09 01:28 -0400
Re: fflush gordonb.o3gsp@burditt.org (Gordon Burditt) - 2011-09-02 21:36 -0500
Re: fflush Keith Thompson <kst-u@mib.org> - 2011-09-03 12:05 -0700
Re: fflush Kenneth Brody <kenbrody@spamcop.net> - 2011-09-06 12:51 -0400
Re: fflush Keith Thompson <kst-u@mib.org> - 2011-09-06 10:51 -0700
Re: fflush "io_x" <a@b.c.invalid> - 2011-09-03 10:13 +0200
Re: fflush "io_x" <a@b.c.invalid> - 2011-09-09 08:19 +0200
csiph-web