I have a problem writing binary data to my harddrive. I am using ofstream to write the data to disk and it works great most of the time. However sometimes the file is not fully written to the disk and is cut off in the middle at different positions - even I use file.flush() and file.close() at the end.
I am writing this data at the end of my code and after I wrote the data - I quit the application. Can anybody point me into the right direction why the file is not always written to disk fully. The file is only 20k in size.