From 6b169e03a8143d13411c6783768386285de498e0 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Tue, 12 Jan 2010 21:54:49 -0800 Subject: [PATCH] Now reading the version of gnuplot on the system, and not using --persist on versions of gnuplot too old to support it. --- feedGnuplot.pl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/feedGnuplot.pl b/feedGnuplot.pl index d37492c..070aebe 100755 --- a/feedGnuplot.pl +++ b/feedGnuplot.pl @@ -8,6 +8,16 @@ use Data::Dumper; use threads; use Thread::Queue; +open(GNUPLOT_VERSION, "gnuplot --version |"); +my ($gnuplotVersion) = =~ /gnuplot\s*([0-9]*\.[0-9]*)/; +if(!$gnuplotVersion) +{ + print STDERR "Couldn't find the version of gnuplot. Does it work? Trying anyway...\n"; + $gnuplotVersion = 0; +} + +close(GNUPLOT_VERSION); + my $usage = < @@ -172,7 +182,11 @@ sub plotThread sub mainThread { local *PIPE; my $dopersist = ""; - $dopersist = "--persist" if(!$options{"stream"}); + + if($gnuplotVersion >= 4.3) + { + $dopersist = "--persist" if(!$options{"stream"}); + } if(exists $options{"dump"}) {