|
From: <br...@ph...> - 2006-07-03 17:23:49
|
Daniel Geberth wrote: > Hello all. > > I have trouble getting gnuplot to accept binary data generated via an > external program. I wrote a C++ routine to output files in the format > specified by the gnuplot help (topic "binary"), but I always get an error > message saying "binary file read error: format unknown". What version of gnuplot did you try this with? I ask because binary file handling was re-done mostly from scratch between 4.0 and now, so there's a chance this broke something. > I took a look inside the binary.c file in order to understand > where my error lies, but I think the output format should be correct (ie, > not end of line characters required). It's more than that. The tricky part is that you must keep your C++ stream I/O library from trying to change the representation of line endings. In C, you would use "wb" mode to get this effect. I'm not sure how one would do it in C++, but from a quick look it seems you have to set the openmode to binary. > I would vastly prefer to not use > fwrite_matrix, because it generates a huge overhead in terms of files I need > to include (and find, first of all), I can't quite see how one C file and its header can amount to "huge overhead"... |