www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/04/10:29:29

Date: Wed, 4 Sep 1996 13:34:03 -0300
Message-Id: <1.5.4.16.19960904104125.380f85f4@dmeasc.rc.ipt.br>
Mime-Version: 1.0
To: elric AT wheel DOT dcn DOT davis DOT ca DOT us (Jeffrey Taylor), djgpp AT delorie DOT com
From: Cesar Scarpini Rabak <csrabak AT dce03 DOT ipt DOT br>
Subject: Re: interrupting with ctrl-C

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019