SomeAlphabetGuy · GitHub

@SomeAlphabetGuy

The previous version opens the matrix file in text mode, reads or writes the header, then re-opens the file in binary mode to read or write the data. This can cause issues on some network filesystems that do not guarantee immediate availability of the file after it is initially written. On such filesystems the Write() method may not see the file after writing the header, which results in overwriting the header instead of appending to it.
After this change the file is opened only once using binary mode. This is OK because the header does not contain any newline characters or non-ASCII characters.

Read the original on github.com ↗