On 11/04/2008, at 12:50 AM, Hans-Joerg Bibiko wrote:
OK. I changed the code of tm_interactive_input for it and in principal it works perfectly ;) It was really quite simple caused by the clean structured source code!
Thank Allan for that, he wouldn't let me stop if it was anything less :P
Now I have an other problem.
I call R spawned by using this R < in_pipe > out.txt
Fine. But if R outputs a huge text chunk tm_interactive_input gives me a signal that R wants to read something, but there're still data in the pipe to out.txt. It takes time to flush the pipe out.txt to disk.
Is there a way to ask the pipe whether it finished writing?
My guess is here that the output is too big for one call to write(). If this is the case then that is a problem, because the logic of when an outputting session stops is external to anything that we control. If this is indeed the case, you are better off trying to pursue it on the R side.
LD.