fmihpc/vlsv

Input files are opened in incorrect mode

Closed this issue · 2 comments

Reader opens the input file in formatted mode in
https://github.com/fmihpc/vlsv/blob/master/vlsv_reader.cpp#L178
which seems to work just fine in every Linux system VLSV has been run on.

I encountered weird issues on Windows 10, however, and I was able to trace it here. Apparently Visual Studio really performs character formatting (unlike Linux) and file can get messed up. The solution is to open the file in binary (unformatted) mode.

filein.open(fnameWithoutPath.c_str(), fstream::in | fstream::binary);
iljah commented

Reader opens the input file in formatted mode in
https://github.com/fmihpc/vlsv/blob/master/vlsv_reader.cpp#L178
which seems to work just fine in every Linux system VLSV has been run on.
|filein.open(fnameWithoutPath.c_str(), fstream::in | fstream::binary);

I think non-binary mode would convert e.g. windows line endings to unix
if the file was read on unix but that's probably not an issue for vlasiator.

Closing this issue, fix was delivered long time ago.