Linux file redirection buffering issue !!!!
I am facing a problem since several days that i can't solve by myself.
Let me explain you my problem.
I am working on a TVbox configured with a small linux kernel.
The default GUI of this box is not efficient, so I will to improve it.
I found the binary launched ('dmaosd') on the box to handle the GUI.
I have developped my own code in C and php to make some tuning of the GUI.
To go further I have to parse some information coming from the running 'dmaosd' binary.
When i lauch the 'dmaosd' binary in a telnet console, it shows its output in a line buffered mode to the console screen.
So I have just make a bash redirection in a log file ('dmaosd > /tmp/GUI.log') to collect all its output in a file in order to be able to parse it with my code.
But the pb I am facing is that the redirection make the 'dmaosd' to fill its output in a block buffer mode in the log file, and not anymore in a line buffered mode.
And i try to find a way to make the kernel to have the same bahaviour in term of buffering between console outputs and log file redirection, but unsucessfully.
I have test several things with the bash redirection, making some C codes to launch the 'dmaosd' through my own C code to force flush and no buffer settings, I have tried to find in the kernel settings where I could change its default buffer behaviours for file IO, but I don't fins someting till now to solve my pb.
is there anybody that could help me on this issue ???
thanks a lot per advance .