From: Robbie M. <ro...@ac...> - 2011-03-09 17:32:58
|
Hello Thomas Many many thanks for this. I will try to test your patch this weekend and report back. with best wishes, Robbie > ------------------------------------------------------------ > To: gnu...@li... > Subject: Re: [Gnuplot-info] name of current script > Message-ID: <311...@ta...> > From: Thomas Sefzick <t.s...@fz...> > Date: Wed, 9 Mar 2011 09:03:45 -0800 (PST) > ------------------------------------------------------------ > > the best place to set such a variable would be the > 'load_file()' routine in 'misc.c'. > > two lines need to be added there: > > --- misc.c.orig 2011-03-08 15:15:32.240304167 +0100 > +++ misc.c 2011-03-09 18:00:13.300516216 +0100 > @@ -215,6 +215,8 @@ > lf_push(fp, name, NULL); /* save state for errors and recursion */ > do_load_arg_substitution = can_do_args; > > + fill_gpval_string("GPVAL_LOAD_FILE", name); > + > if (fp == (FILE *) NULL) { > os_error(c_token, "Cannot open %s file '%s'", > can_do_args ? "call" : "load", name); > @@ -286,6 +288,8 @@ > } > } > > + fill_gpval_string("GPVAL_LOAD_FILE", ""); > + > /* pop state */ > (void) lf_pop(); /* also closes file fp */ > } > > Robbie Morrison wrote: >> >> >> Hello all >> >> It would be rather useful if the current filename was >> available from within a gnuplot script. [snip - feature request] --- Robbie Morrison PhD student -- policy-oriented energy system simulation Technical University of Berlin (TU-Berlin), Germany University email (redirected) : mor...@ie... Webmail (preferred) : ro...@ac... [from Webmail client] |