h5unjam(1)
π h5unjam β ok so bestie, let me put you on
Welcome to the h5unjam page, straight out of your General Commands Manual π (yes, section 1, we're in the big leagues).
β¨ NAME β¨
h5unjam β extract the user block from a HDF5 file π¦
Like, it takes the lil' mystery chunk off the front of your HDF5 file and hands it to you separately. Iconic behaviour honestly.
πΈ SYNOPSIS πΈ
h5unjam -i in_file.h5 [-u user_block | --delete] [-o out_file.h5]
π DESCRIPTION π
Okay so here's the tea, bestie β β h5unjam splits an HDF5 file. It writes the user block out to a file or to stdout, and it writes the HDF5 file out to an HDF5 file with a header at byte 0 (i.e., with no user block). Two halves, one glow-up. β¨
- If
out_file.h5is given, a new file is created with the contents ofin_file.h5minus the user block. In this case,infile.h5is unchanged β your original stays untouched, we're respectful like that π - If
out_file.h5is not specified, theuser_blockgets removed andin_file.h5is rewritten, starting at byte 0. So yeah, that one edits in place, no cap π - If
user_blockis set, the user block will be written touser_block. Ifuser_blockis not set, the user block (if there is any) will be written to stdout. And if--deleteis selected, the user block will not be not written. (Read that twice, it's a double negative and it's lowkey a vibe π)
π EXAMPLE USAGE π
Say you've got an HDF5 file, with_ub.h5, that has a user block. You wanna extract that user block into user_block.txt and the HDF5 file into wo_ub.h5. So you do:
h5unjam -i with_ub.h5 -u user_block.txt -i wo_ub.h5
There it is. Slay. π
β RETURN VALUE β
h5unjam returns the size of the output file, or -1 if an error occurs. That's it, that's the whole report card. π―
π CAVEATS π
Okay now the serious part, and I need you to listen bestie, because this is where people get got:
- This tool copies all the data (sequentially) in the file(s) to new offsets. For a large file, this copy will take a long time. Like, go make a snack. Go touch grass. It's coming back when it's coming back π
- The most efficient way to create a user block is to create the file with a user block (see
H5Pset_user_block), and write the user block data into that space from a program. Do it right the first time, fr fr. - The user block is completely opaque to the HDF5 library and to the
h5jamandh5unjamtools. It's simply read or written as a string of bytes, which could be text or any kind of binary data. It is up to the user to know what the contents of the user block mean and how to process them. Nobody here is reading your diary, we just move the bytes π - When the user block is extracted, all the data is written to the output, including any padding or unwritten data. Yeah. All of it. Even the weird empty parts. π
- This tool moves the HDF5 file through byte copies, i.e., it does not read or interpret the HDF5 objects. It's not analyzing anything, it's just shoving bytes around, main character energy only π§
β οΈ Lowkey important: those in-place rewrites and long byte-copy runs are exactly as slow and exactly as destructive as they sound. Plan accordingly, babes.
π«Ά SEE ALSO π«Ά
Go check out the whole friend group:
and that's the whole page, bestie β¨ This was h5unjam(1) from the General Commands Manual β the very same title line we opened with, now closing us out. Go forth, unjam your user blocks, and hydrate. πππ¦πΈπ
π¦ where this page comes from
- debian bookworm: hdf5-tools 1.10.8+repack1-1 Β· BSD-3-Clause
- debian trixie: hdf5-tools 1.14.5+repack-3 Β· BSD-3-Clause
- epel 10: hdf5 1.14.5-1.el10_0 Β· BSD-3-Clause
- epel 9: hdf5 1.12.1-7.el9.1 Β· BSD
- fedora 43: hdf5 1.14.6-6.fc43 Β· BSD-3-Clause
- fedora 43: hdf5 1.14.6-6.fc43 Β· BSD-3-Clause
- fedora 44: hdf5 1.14.6-7.fc44 Β· BSD-3-Clause
- fedora 44: hdf5 1.14.6-7.fc44 Β· BSD-3-Clause
- ubuntu jammy: hdf5-tools 1.10.7+repack-4ubuntu2 Β· BSD-3-Clause
- ubuntu noble: hdf5-tools 1.10.10+repack-3.1ubuntu4 Β· BSD-3-Clause
- ubuntu questing: hdf5-tools 1.14.5+repack-3build1
- ubuntu resolute: hdf5-tools 1.14.6+repack-2 Β· BSD-3-Clause
- ubuntu stonking: hdf5-tools 2.2.0+repack-5 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms