Platform-dependent 'char' size can break loading #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From the MATLAB documentation for
fread, thechardatatype does not have a fixed size. On my platform (Manjaro with kernel6.12.19-1-MANJAROand MATLAB 2025a Prerelease Update 5) this resulted in broken reading of trigger in DAT files. It's not immediately obvious to me why it breaks, as the event type and size do not take on values that could confuse MATLAB if it were reading them as e.g. UTF-8. I've attached a hexdump of the file in question at the end of this PR.In any case, this can be fixed by specifying a well-defined datatype (
uint8) that is converted tochar. It's not immediately clear to me whycharis used instead of a proper integer type, but for posterity I have left it as the output type.I also (pedantically) changed the capitalization of the timestamp unit. In SI, a capital "S" denotes siemens rather than seconds.
Mis-read trigger file