I have an HDF5 file with the chunked one-dimensional dataset with ~280 entries, where every entry is a variable-length array. When I want to read the item, only 8 bytes get written into the output buffer, even if the length, returned by the H5Dvlen_get_buf_size is ~5000 (which is correct).
See simplified example. Error checking removed, but all functions gave successful return codes ---------------------------- hid_t datasetStream=H5Dopen2( file, "Stream", H5P_DEFAULT ); hid_t filespaceStream = H5Dget_space(datasetStream); hsize_t countPacket=1; hid_t memspaceStream = H5Screate_simple(rank,&countPacket,NULL); hid_t dType=H5Tvlen_create(H5T_NATIVE_UCHAR); hsize_t mSize; H5Dvlen_get_buf_size(datasetStream, dType, memspaceStream, &mSize ); // mSize has a correct length hsize_t startPacket=indexPacket; // for example,0 H5Sselect_hyperslab(filespaceStream, H5S_SELECT_SET, &startPacket, NULL,&countPacket, NULL); H5Dread(datasetStream, dType, memspaceStream, filespaceStream,H5P_DEFAULT,dstData); ---------------------------- Vadim Karpenko
_______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5
