I have a (somewhat old) file that was created from a Fortran script and contains a struct without any padding. I try to read the file as follows
struct Foo
id::UInt32
Value::Int64
end
io = open(filepath, "r")
rows = Mmap.mmap(io, Vector{Foo}, nrows)
sa = StructArray(rows)
However, because the default behavior is to add padding between id
and Value
the size of Foo
is wrong and I get nonsense.
Is there a way to disable the padding?
My main concern here is to optimize loading the file into a StructArray, as the files are ~10GB and I need to load hundreds of them in my computations while also query the entire files. If there is a better way to load them Iād be happy to learn.