[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: progress meter for long operations
From: |
John W. Eaton |
Subject: |
Re: progress meter for long operations |
Date: |
Tue, 26 Jun 2001 04:50:25 -0500 |
On 25-Jun-2001, Jonathan C. Webster <address@hidden> wrote:
| > does anyone have a good method for announcing progress on long operations? i
| > tried putting a printf in a for loop, but it didn't print a thing out until
| > it was done,
|
| Use unbuffered writes to a log file and then watch that. (tail -f stuff.log
| )
| I use code like the following, where FID is the filehandel of your log file.
|
| str1 = sprintf("Blah Blah %d %f \n", var1, var2 );
| fputs(FID,str1);
I'm pretty sure fputs is normally buffered, unless you happen to have
set the buffering mode on FID to unbuffered, or that has already been
done for you (stderr, for example).
Probably what you want is fflush, or to check out Octave's built-in
variables page_screen_output and page_output_immediately.
jwe
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------