[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: progress meter for long operations
From: |
Jonathan C. Webster |
Subject: |
Re: progress meter for long operations |
Date: |
Tue, 26 Jun 2001 13:58:21 -0400 |
"John W. Eaton" wrote:
> 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
I use the above coding for this purpose often using Octave, version 2.0.14
(i386-redhat-linux-gnu).
and
FID = fopen( "debug.log", "w");
Jonathan
-------------------------------------------------------------
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
-------------------------------------------------------------