|
From: Petr M. <mi...@ph...> - 2003-11-28 08:08:14
|
> On Tuesday 25 November 2003 05:58, Petr Mikulik wrote: > > > <stdio.h>: FILE *tmpfile(void) > > > > Unfortunately this does not provide name of the file which I could use > > in plot 'tmp_file1' > > You wouldn't need a file name if you wrote the data as an in-line command: > plot '-' > xx xx xx > xx xx xx > E > and then passed the FILE pointer directly to load_file(). > > So the code would look like: > pre1 = tmpfile(); data = tmpfile(); post1 = tmpfile(); > fprintf(pre1, buf1); /* write preliminary commands */ > fprintf(data, buf2); /* write inline data for plot */ > fprintf(post1, buf3); /* write any trailing commands */ > rewind(pre1); rewind(data); rewind(post1); > load_file(pre1, ...); > load_file(data, ...); > load_file(post1, ...); > > > > save set 'tmp_file2' > > A similar trick should work here: > save_set(savefp=tmpfile()); > ... > load_file(savefp, ...); In the final rework, it turned out that it is sufficient to use only one temporary file once submitted to load_file(). --- Petr Mikulik |