fix(format): write a Group Info message in every group
libhdf5 reads a group's Group Info message before it inserts a link, and FileWriter wrote none, so h5py in "r+" mode could not add a link to any group we wrote: "Unable to create link (message type not found)". Each group header now carries a version 0 Group Info message with the default link-phase thresholds, as libhdf5 writes for a new group. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
@@ -196,6 +196,13 @@ pub(crate) fn build_group_oh(
|
||||
li.extend_from_slice(&u64::MAX.to_le_bytes()); // fractal heap addr = UNDEF
|
||||
li.extend_from_slice(&u64::MAX.to_le_bytes()); // btree name index addr = UNDEF
|
||||
w.add_message(MessageType::LinkInfo, li);
|
||||
}
|
||||
// Group Info (version 0, default link-phase thresholds, no estimates).
|
||||
// Readers don't need it, but libhdf5 reads it before inserting a link:
|
||||
// without one, adding a link to a group we wrote (h5py in "r+" mode)
|
||||
// failed with "message type not found".
|
||||
w.add_message(MessageType::GroupInfo, vec![0, 0]);
|
||||
if dense_link_info.is_none() {
|
||||
for link in links {
|
||||
w.add_message(MessageType::Link, link.serialize(OFFSET_SIZE));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user