Hi,
Also I'm saving some variables into a file. What I did:
Before the work function:
myfile.open ("/home/Desktop/examples/variables_from_block");
Then, inside the work function:
myfile << _msg.key; //Save the variable value
myfile << std::flush;
I've found that I have to std::flush the file, because if I close it
(myfile.close()), I cannot access the file anymore and the variable is
saved once only.
Hope this helps,
Cheers,
Jose
On Wed, Oct 24, 2012 at 7:37 AM, sumitstop
<[email protected]>wrote:
> Well I am pretty sure that your query is more complicated than what I am
> thinking, but I did the following just to check. Inside the work function
> of
> howto_square_ff.cc
>
> I pasted following lines
>
> ofstream outdata;
> int i; // loop index
> int num[5] = {4, 3, 6, 7, 12}; // list of output values
> outdata.open("/home/sumit/example2.dat");
> for (i=0; i<5; ++i)
> outdata << num[i] << std::endl;
> outdata.close();
>
> compiled it ...
>
> And I got them written in example2.dat
>
> Anyways I am curious to see if you get some effective reply :)
>
>
>
>
>
> --
> View this message in context:
> http://gnuradio.4.n7.nabble.com/saving-internal-to-a-block-variable-values-to-a-file-tp38118p38125.html
> Sent from the GnuRadio mailing list archive at Nabble.com.
>
> _______________________________________________
> Discuss-gnuradio mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio