You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default fwrite() uses internal buffering instead of writing to file directly (as would be reasonable in case of logging). Such buffering means both extra work (performance) and either potential for losing the tails (reliability) or flushing after each write.
A quick solution could be calling setbuf() with buffer set to nullptr (effectively turning buffering off).
Another way is to use posix calls (open(), write(), etc).
On Windows it's reasonable to use win32 api, which is, ultimately, used anyway.