egeldenhuys/prothesis

Fix code writing UserData files.

Closed this issue · 2 comments

Using std::endl on a file stream flushes the buffer.

.dat files are usually binary files and in some cases executables ( The old EA games hid its executable inside of .dat files ) in any case make sure you open these files as binary if your intent was to save a binary file.

I'll clone the code a bit later and fix the buffer flushing ^-^

From the COS 110 practicals I now see that std::endl does indeed flush the buffer and is expensive in terms of I/O, you are correct from #146 .

Currently we are writing using the .dat extension for plain text files. I thought it would be fitting for storing User Data.

Look forward to seeing a pull request from you

Already using buffers when saving to disk.