Commits
clee83 committed e202d10d1ff
Add -latest option for long attributes. Some HDF-EOS2 files have very long attributes; They contain 65535 characters. It seems HDF5 has some limitation regarding the length of attribute. I got the following error: HDF5-DIAG: Error detected in HDF5 (1.8.1) thread 0: #000: ../../hdf5/src/H5Adeprec.c line 165 in H5Acreate1(): unable to create attribute major: Attribute minor: Unable to initialize object #001: ../../hdf5/src/H5A.c line 481 in H5A_create(): unable to create attribute in object header major: Attribute minor: Unable to insert object #002: ../../hdf5/src/H5Oattribute.c line 343 in H5O_attr_create(): unable to create new attribute in header major: Attribute minor: Unable to insert object #003: ../../hdf5/src/H5Omessage.c line 228 in H5O_msg_append_real(): unable to create new message major: Object header minor: No space available for allocation #004: ../../hdf5/src/H5Omessage.c line 1933 in H5O_msg_alloc(): unable to allocate space for message major: Object header minor: Unable to initialize object #005: ../../hdf5/src/H5Oalloc.c line 974 in H5O_alloc(): object header message is too large major: Object header minor: Unable to initialize object The actual size the H5O_alloc() tries to allocate was about 65583. I guess HDF5 adds some sort of headers, and any size longer than 65536 was explicitly checked and rejected. One easiest solution seems to call H5Pset_libver_bound(, LATEST, LATEST), and this changes the size the H5O_alloc() tries to allocate. This made the conversion successful. This changelist adds one command line option "-latest", which makes h4toh5 call H5Pset_libver_bound(). However, I'm commenting the code calling H5Pset_libver_bound() out at this point because it may cause errors when H4H5TOOLS is linked with HDF5 1.6, which does not support H5Pset_libver_bound().