Mail Archives: djgpp-workers/2000/09/23/13:36:34
> From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
> Date: Sun, 17 Sep 2000 19:47:27 +0200 (MET DST)
>
> if(__file_handle_modes[handle] & O_BINARY)
> return _write(handle, buf, count);
>
> /* Let's handle FSEXT_write ! */
> if(func && /* if handler is installed, ...*/
> func(__FSEXT_write, &rv, &handle)) /* ... call extension ... */
> return rv; /* ... and exit if handled. */
>
> This seems to mean that if a file is open()ed with O_BINARY, the FSEXT
> won't be called.
It *will* be called: by `_write' itself.
The normal case is for the FSEXT to be called by the lowest-level
primitives, just before DOS is called. In this case, that's `_write',
not `write'. The fact that here `write' calls an FSEXT is an
exception rather than a rule. This code was added to `write' in
preparation for v2.03, to fix a bug whereby FSEXT was not called on
text-mode writes, because `write' wasn't calling `_write' for text
files...
- Raw text -