# Extent the dataspace of an existing attribute

**URL:** <https://forum.hdfgroup.org/t/extent-the-dataspace-of-an-existing-attribute/9464>\
**Category:** HDF5 Library\
**Created:** [March 3, 2022, 10:32am UTC](https://forum.hdfgroup.org/t/extent-the-dataspace-of-an-existing-attribute/9464 "2022-03-03T10:32:34Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![gheber](https://forum.hdfgroup.org/user_avatar/forum.hdfgroup.org/gheber/32/1919_2.png) [@gheber](https://forum.hdfgroup.org/u/gheber)\
**Post date:** [March 3, 2022, 7:26pm UTC](https://forum.hdfgroup.org/t/extent-the-dataspace-of-an-existing-attribute/9464/6 "2022-03-03T19:26:54Z")

</div>

I thank and agree with my fellow responders @steven and @dave.allured.

Maybe the path of least resistance might be a “dimensions” attribute (NetCDF 😉) whose type is a variable-length sequence of the string-pair compound (which presumably holds the quantity name or symbol and the unit designation). The length and order of elements of the sequence would be expected to be in sync with the leading dimension of your extendible dataset. The only quirk would be that appending a new dimension would mean that you must `H5Aread` the whole sequence, extend it (in memory), and then `H5Dwrite` the whole attribute again. Not pretty, but, unless your are constantly changing dimensions, not really a performance bottleneck for a few string-pair records.

Best, G.

---

_[View the full topic](https://forum.hdfgroup.org/t/extent-the-dataspace-of-an-existing-attribute/9464)._
