Open binary files in binary mode for proper data reading#134
Merged
Conversation
…compatibility On Windows, 'r' opens in text mode which corrupts binary reads. Changed to 'rb' in all custom_file_formats files that read binary data (both +vlt/+file and file/ copies). https://claude.ai/code/session_014KgYyEcCWi1uoMBTK6rj4d
…' -> 'uint8' Changed fopen mode from 'r' to 'rb' across all binary file readers: - +vlt/+file/: loadIgor, readlabviewarray, arefilessame - file/: loadIgor, readlabviewarray (non-namespaced copies) - Intan-RHD2000: 8 files - CED-SOM_SMR: 3 files - SpikeGadgets-REC: 5 files Also changed arefilessame.m fread from 'char' to 'uint8' since it does raw byte comparison, not character interpretation. https://claude.ai/code/session_014KgYyEcCWi1uoMBTK6rj4d
Runs vlt.unittest test suite on pushes to main, PRs targeting main, and manual dispatch. Installs Statistics/ML, Curve Fitting, Optimization, Signal Processing, and Image Processing toolboxes. https://claude.ai/code/session_014KgYyEcCWi1uoMBTK6rj4d
The default branch is master, not main. https://claude.ai/code/session_014KgYyEcCWi1uoMBTK6rj4d
…d Deep Learning Toolbox - test_hashmatlabvariable: skip all tests if DataHash is not installed - hashmatlabvariable.m: add note that DataHash is a required dependency - drivepathTest: fix typo GLNXA66 -> GLNXA64 so Linux case matches - CI workflow: add Deep_Learning_Toolbox for imageInputLayer https://claude.ai/code/session_014KgYyEcCWi1uoMBTK6rj4d
- deprecated test_hashmatlabvariable: skip if DataHash not installed - test_savefigurelist (both copies): use addTeardown to cd to tempdir as safety net, since another test's teardown can delete the original working directory before this test's cd(originalDir) runs https://claude.ai/code/session_014KgYyEcCWi1uoMBTK6rj4d
…le it The original working directory may already be deleted by another test's teardown, so cd(originalDir) fails. Instead, rely solely on addTeardown(@() cd(tempdir)) to restore a valid working directory. https://claude.ai/code/session_014KgYyEcCWi1uoMBTK6rj4d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Updated all file open operations to use binary mode ('rb' or 'rb' with endianness specifiers) instead of text mode ('r') when reading binary data files. This ensures proper handling of binary file content across different platforms and MATLAB versions.
Key Changes
fopen()calls from'r'to'rb'mode in 25+ files across multiple modules:arefilessame.m)fread()calls from'char'to'uint8'data type in binary file comparison to maintain consistency with binary mode readingImplementation Details
https://claude.ai/code/session_014KgYyEcCWi1uoMBTK6rj4d