Mail Archives: djgpp/2013/12/03/07:55:23
> Date: Tue, 03 Dec 2013 13:39:45 +0100
> From: Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
>
> It has no influence if I call clearerr. The flags that are cleared are not set
> before the call. It works reliably in all variants if I open the file for reading
> after having closed the write handle.
If you stepped through fread and its subroutines with a debugger, and
saw that _filbuf is actually called, and calls _read (as opposed to
just returning a -1 based on some flag), then I guess what you see is
the difference in the implementation of INT 21h function 3Fh between
the different systems. Probably DOS records internally the size of
the file when you open a handle for reading, or something similar.
But do be sure that the error indeed comes from _read and not from
some information recorded in the FILE object from before the file is
closed.
- Raw text -