I think his point was that it was implicitly flushed at every write, and not being buffered, but I might have misunderstood.

Anyway, I wouldn't expect fwrite to buffer on a per-line basis. fwrite is basically there for doing binary I/O. If you want something buffered, line oriented and user friendly, I would suggest printf.

  Johnny

On 2021-05-14 12:22, Alan Carvalho de Assis wrote:
Hi Jernej,

Please define "not working"! :-)

Are you flushing it? Also "\n" at end of line forces it to be flushed.

BR,

Alan

On Friday, May 14, 2021, Jernej Turnsek <jernej.turn...@gmail.com> wrote:

Hi all,

while working with stdout fwrite function, I have noticed that line
buffering is not working. Is this by design or it is a bug?

Regards,
Jernej



--
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: b...@softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol

Reply via email to