|
From: Ethan M. <merritt@u.washington.edu> - 2006-03-03 21:10:13
|
On Friday 03 March 2006 10:44 am, Petr Mikulik wrote:
> > It seems to me easier to use system("find . -name <foo> -newer
> > <bar>")
>
> This is not portable either.
Not universally. But it works without any changes to gnuplot.
Why add a new routine to gnuplot if it doesn't give any advantage
over what you can already do?
> Actually, the most trivial solution seems to be:
I think you meant:
if (!defined(prev)) prev = "" # first time only
new=system("ls -l bla.dat")
if (new ne prev) plot 'bla.dat'
prev = new
pause 5; reread
But this doesn't work very well.
`ls -l` will not tell whether new data has been written since your
previous plot. For one thing, the time is only given to the nearest
minute. I thought you wanted a real-time test, that would update on
the order of seconds? There is a gnu-specific extension:
`ls --full-time`, but this won't help you on general unix boxes and
it certainly won't help on VMS or other less unix-like systems.
Anyhow, is there anysystem that provides "ls" that does not also
provide "find"?
> ??? how to detect that a variable has not been initialized?
if (defined(VAR))
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle WA
|