Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!sharkey!math.lsa.umich.edu!zaphod.mps.ohio-state.edu!sunybcs!sbcs!stealth!brnstnd From: brnstnd@stealth.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.questions Subject: Re: How to flush output to disk? Message-ID: <4176@sbcs.sunysb.edu> Date: 6 Dec 89 21:10:38 GMT References: <606@caldwr.UUCP> <1025@friar-taac.UUCP> Sender: news@sbcs.sunysb.edu Reply-To: brnstnd@stealth.acf.nyu.edu (Dan Bernstein) Distribution: usa Organization: IR Lines: 20 In article <606@caldwr.UUCP> rfinch@caldwr.UUCP (Ralph Finch) writes: > Is there any way to force the output to be flushed more often, say every > 15-30 minutes? It sounds like you want stdio output flushed, as in the fflush() call. If changing the source to use fflush() is impossible, stick the program under a pty (using, for example, my pty program) so that stdio writes each line as soon as it sees the newline. In article <1025@friar-taac.UUCP> matthew@friar-taac.UUCP (Matthew Stier - Sun Visualization Products) writes: > The following, untested, script should do it. > (I know using 'sync' is a little heavy > handed, but it gets the job done.) sync makes sure that the data in the buffers is (at least scheduled to be) written to disk; this doesn't affect any normal operations other than straight reads from the raw disk device. In particular, it certainly doesn't affect stdio. ---Dan