Hi Mark,
On May 24, 2010, at 11:46 AM, Mark Miller wrote:
> On Mon, 2010-05-24 at 09:40, Quincey Koziol wrote:
>> Note, if you write 'int' on your 64 bit
>>> system and the values are small enough to fit into 32 bit, I am not sure
>>> if HDF5 will handle reading it into an 'int' on your 32 bit system or
>>> not. I think it will but I am not sure. You could explicitly attempt to
>>> read it into long int or long long or int64 if your system supports
>>> those types AND they are indeed 64 bit.
>>
>> Yes, the conversion will work, but your values may be truncated.
>
> So, on this point, I just wanted to make sure I understand. Will HDF5
> silently and without error convert a dataset consisting of 64 bit ints
> to 32 bit ints if all values are within range of the destination type?
Yes.
> If just one value is out of range, will it fail the WHOLE read or just
> truncate that one value and if latter, what kind of error, if any, is
> triggered?
It will normally just truncate that one value and won't issue an error.
If an application desires to see all the exceptions that occur during datatype
conversion when performing I/O on a dataset, it can use the
H5Pset_type_conv_cb() routine
(http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetTypeConvCb) to
register a callback that can intervene or record them.
Quincey
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org