Mail Archives: djgpp/1996/09/04/10:29:29
At 22:02 03/09/96 GMT, Jeffrey Taylor wrote:
>Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) wrote:
>:
>: On Thu, 29 Aug 1996, Erik Max Francis wrote:
>:
>: > Or just use fflush.
>:
>: `fflush' is not enough when redirection is used, or when you invoke a
>: child program that reads from a file written by the parent. You should
>: either close the file or call `fsync' to ensure DOS flushes its buffers.
>: `fflush' only flushes the DJGPP buffers, but not the DOS ones.
>
>If you are using SMARTDRV, its buffers need to be flushed too. Off the
>top of my head, I would spawn a call to run "smartdrv /c"
>
But wouldn't this become too expensive computationally? I believe that
calling int 21h function FLUSH BUFFERS (COMMIT CACHE) (AX = 4A10h;
BX = 0001h) would be more productive. Of course, it would be wise to do an
"installation check" for SMARTDRV int the program's startup...
Also it could be combined with Eli's proposal of calling int 21h DOS 3.3+ -
"FFLUSH" - COMMIT FILE (AH = 68h; BX = file handle), into a single
"my_fflush" function that would do all this for a given file stream (or
handle, if one prefers working with these functions).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cesar Scarpini Rabak E-mail: csrabak AT ipt DOT br
DME/ASC Phone: 55-11-268-35221Ext.350
IPT - Instituto de Pesquisas Tecnologicas Fax: 55-11-268-5996
Av. Prof. Almeida Prado, 532. Sao Paulo - SP 05508-901 BRAZIL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Raw text -