Skip to content

Fix: MAT_v5.getvarnames(): Read variable header with opaque type support#244

Merged
matthijscox merged 4 commits into
JuliaIO:masterfrom
foreverallama:matv5-varnames
Jun 8, 2026
Merged

Fix: MAT_v5.getvarnames(): Read variable header with opaque type support#244
matthijscox merged 4 commits into
JuliaIO:masterfrom
foreverallama:matv5-varnames

Conversation

@foreverallama

Copy link
Copy Markdown
Contributor

MAT_v5.getvarnames() did not account for the different variable header format for opaque type variables. This resulted in methods like keys(file), haskey(file, "var") and read(file, "var") erroring out.

For opaque type variables, the second header element is the variable name. For all other types, the third header element is the variable name. The fix below reads variable name based on variable type (opaque/non-opaque).

Misc: Additionally, variables with no names are skipped (this is always the subsystem block)

Fixes #242

@foreverallama

Copy link
Copy Markdown
Contributor Author

CC @matthijscox

@matthijscox

Copy link
Copy Markdown
Member

Nice!
Lets do a version bump and merge

@foreverallama

Copy link
Copy Markdown
Contributor Author

Done! There's also #241 which you can merge first

@matthijscox matthijscox merged commit 20fcaa0 into JuliaIO:master Jun 8, 2026
8 checks passed
@foreverallama foreverallama deleted the matv5-varnames branch June 12, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MAT_v5: ZlibError when reading valid compressed v5 files saved by MATLAB on Windows (PCWIN64)

2 participants