www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/19/11:30:27

Xref: news2.mv.net comp.os.msdos.djgpp:7630
From: brucef AT central DOT co DOT nz (Bruce Foley)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: interrupting with ctrl-C
Date: Mon, 19 Aug 1996 05:16:40 GMT
Organization: Internet Company of New Zealand
Lines: 20
Message-ID: <4v90df$qst@status.gen.nz>
References: <4un5jr$9li AT due DOT unit DOT no>
NNTP-Posting-Host: brucef.central.co.nz
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

jacobsen AT kjemi DOT unit DOT no (Elling Jacobsen) wrote:

>Hello,
>I have a program in which I write data records to a
>number of files. My problem is that when I interrupt
>the program using ctrl-C, the files are left empty. I guess
>the reason is that the data are kept in memory and are
>not dumped to file at interrupt? Is there any way to
>ensure that all data records are written to file at
>interrupt?

As well as the suggestion by Eli, also consider closing
your file after each record has been written and then re-opening it.
This is because writing to the file is not enough to ensure that it
has actually been committed to disk.  Closing the file will ensure
this happens.

Regards, Bruce.


- Raw text -


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