|
From: Ethan M. <merritt@u.washington.edu> - 2006-03-03 17:42:28
|
On Friday 03 March 2006 02:25 am, Petr Mikulik wrote:
> > Can you give an example of why such a thing is needed?
>
> Example 1:
> plot 'measure.dat'
> if fileexist('fit.dat') replot 'fit.dat'
> pause 5
> reread
So far as I know, with the current cvs version you might
just as well say
plot 'measure.dat','fit.dat'
pause 5
reread
A missing data file should no longer prevents the plot from being
constructed.
> Example 2:
> Execution of commands passed via pipes between gnuplot and octave
> (for example) takes some time and it's hard to stop/wait without
> breaking the script (error message). The above solution is fine for
> some cases.
I do not follow you there at all.
Neither your `test` nor your access() or fopen() will work on a pipe.
> Actually, what some users ask for real-time plotting, is something
> like
> pause untilfilechanged "next.dat"
I doubt there is a universally portable solution to this one.
It is difficult even if you restrict the solution to linux/unix.
The best I can think of without writing an external helper that
monitors the file is something like:
ready = words(system("find . -name 'next.dat' -newer 'lock'"))
if (ready) plot "next.dat"
if (ready) system("touch lock")
pause 1
reread
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle WA
|