X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Sun, 14 Jul 2013 02:33:55 -0400 Message-Id: <201307140633.r6E6Xtut000466@envy.delorie.com> From: DJ Delorie To: djgpp AT delorie DOT com In-reply-to: <51E200D7.1050800@gmx.de> (message from Juan Manuel Guerrero on Sun, 14 Jul 2013 03:37:27 +0200) Subject: Re: A question about the ferror behavior References: <51E200D7 DOT 1050800 AT gmx DOT de> Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk My guess is that a DOS read() will error on a file opened for writing. For read/write access to a file, you should have "w+" instead. (the error flag looks to be set due to the raw error from _read(), but that error itself isn't stored, so you'd have to add something to the library to see the raw OS error)