| delorie.com/archives/browse.cgi | search | 
Eli Zaretskii writes:
 > The issue is something else: whether ferror should return true or
 > false after you try those scenarios.
Yes, I know that.  I'm responding to peripheral issues *you* brought
up, trying to clarify my position that ferror *should* return true in
those scenarios.
Here's what I've already said on that issue:
(1) The standards don't say explicitly, as several people have stated.
(2) A large number of tested OS/libcs all have implemented ferror to
    return true.  (I didn't say that, Juanma did.)
(3) It is plausible that if you requested a read-only file handle,
    it's an error if you try to write to it (because it's a logic
    error -- you should have known better), and vice versa.
(4) It is convenient for ferror to return true in those cases in
    principle (ie, without depending on the consensus in (2)), because
    ferror true implies that is a bad idea to retry the operation.
| webmaster | delorie software privacy | 
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |