HDF5: Writing to a Compound Table

How do I write data to a compound table in an HDF5 file?

I’ve figured out how to create the table.

src = "/home/user/Desktop/hdf5_test.h5"

h5open(src, "w") do file
	cols = ["foo","bar","blah","blahblahblah"]
	memtype_id = HDF5.h5t_create(HDF5.H5T_COMPOUND, length(cols)*sizeof(Float64))
	for i=1:1:length(cols)
		HDF5.h5t_insert(memtype_id,cols[i], (i-1)*sizeof(Float64), HDF5.hdf5_type_id(Float64))
	end
	dt = HDF5Datatype(memtype_id)
	#ds = dataspace((20,))
	ds = dataspace((-1))
	d = d_create(file, "CompoundTable", dt, ds)
end

Going through the source in the HDF5 package and the HDF5 Group documentation has helped me get this far but now I’m stuck.

2 Likes