Hello,
I have a question regarding file output using <stdio.h>. First, let me give a bit of background on what I am doing.
I am using extensive logging in a game modification to help find crashes. I am currently logging every function call and the number of writes is around 6,000 per second. As this is meant to track the last function called before a crash, the log must always be up to date when the game crashes. Currently, I am using fflush after every write to ensure this.
My problem is that calling fflush 6,000 times per second is very slow. If I have queued writes (due to not calling fflush) and my program crashes, will they still get written properly or will they be lost? I am not concerned if the OS crashes, only the program.