I'm using rhdf5 to read a large number of hdf5 files. Occasionally I encounter a file that may be corrupt or otherwise damaged, and rhdf5 (or anything else) is unable to open it. This results in a large spew of error messages to the screen.
HDF5-DIAG: Error detected in HDF5 (1.8.7) thread 0: #000: H5F.c line 1522 in H5Fopen(): unable to open file major: File accessability minor: Unable to open file #001: H5F.c line 1313 in H5F_open(): unable to read superblock major: File accessability minor: Read failed #002: H5Fsuper.c line 351 in H5F_super_read(): unable to load superblock major: Object cache minor: Unable to protect metadata #003: H5AC.c line 1322 in H5AC_protect(): H5C_protect() failed. major: Object cache minor: Unable to protect metadata #004: H5C.c line 3567 in H5C_protect(): can't load entry major: Object cache minor: Unable to load metadata into cache #005: H5C.c line 7957 in H5C_load_entry(): unable to load entry major: Object cache minor: Unable to load metadata into cache #006: H5Fsuper_cache.c line 471 in H5F_sblock_load(): truncated file major: File accessability minor: File has been truncated HDF5: unable to open file
I've written a function to catch these files before I try to do anything else with them by looking at the result of H5Fopen()
, but the error messages are still printed to screen. Is there some way to suppress them?
If it's of any help you can get examples of good and bad hdf5 files from here:
https://dl.dropboxusercontent.com/u/16340004/good.h5
https://dl.dropboxusercontent.com/u/16340004/bad.h5
Thanks,
Mike
Thanks very much Bernd. I was hoping to be able to use
suppressErrors()
or the like, so this sounds exactly what I was hoping for.