Hi Roger,

Does using HDFView's File -> Open Read-Only menu item help with the issue of 
changes being made to the file? This should cause HDFView to open the file with 
H5Fopen's H5F_ACC_RDONLY flag and should at least help with this particular 
issue.


I've entered a bug report against the tools so that we can keep track of the 
issue with them not reporting file open issues and hopefully we will be able to 
address this sooner rather than later. I'll also go ahead and mention the issue 
with the disparity between h5clear in CMakeLists.txt vs Makefile.am; that 
should be a simple fix in this case.


Thanks,

Jordan

________________________________
From: Hdf-forum <hdf-forum-boun...@lists.hdfgroup.org> on behalf of Roger Leigh 
<rle...@dundee.ac.uk>
Sent: Monday, January 8, 2018 6:19:38 AM
To: hdf-forum@lists.hdfgroup.org
Subject: Re: [Hdf-forum] A number of small problems

On 05/01/18 17:55, Jordan Henderson wrote:
> Ah yes, after taking a quick glance at the source of h5ls I see why this
> doesn't help any. H5ls tries to open the file using each of the
> available file drivers until it is successful or exhausts the list.
> Since it expects failures to occur when attempting to open the file with
> an incorrect file driver, it explicitly disables the error stack during
> file open and this is why you won't see the error stack for the true
> failure. Not a very elegant solution, but I can see why it was done.
>
>
> If you are familiar with editing the HDF5 source code and rebuilding, I
> can show you where the issue is at in the source code for h5ls.

I just wrote a tiny test problem calling H5Fopen and got this:

% ./read idr016-broken.h5
Open HDF5 file 'idr016-broken.h5' for reading
HDF5-DIAG: Error detected in HDF5 (1.10.0-patch1) thread 140201515243328:
   #000: ../../../src/H5F.c line 579 in H5Fopen(): unable to open file
     major: File accessibilty
     minor: Unable to open file
   #001: ../../../src/H5Fint.c line 1297 in H5F_open(): file is already
open for write (may use <h5clear file> to clear file consistency flags)
     major: File accessibilty
     minor: Unable to open file
Open dataset 'Simple/2DArray'
HDF5-DIAG: Error detected in HDF5 (1.10.0-patch1) thread 140201515243328:
   #000: ../../../src/H5D.c line 286 in H5Dopen2(): not a location
     major: Invalid arguments to routine
     minor: Inappropriate type
   #001: ../../../src/H5Gloc.c line 253 in H5G_loc(): invalid object ID
     major: Invalid arguments to routine
     minor: Bad value
HDF5-DIAG: Error detected in HDF5 (1.10.0-patch1) thread 140201515243328:
   #000: ../../../src/H5D.c line 449 in H5Dget_type(): not a dataset
     major: Invalid arguments to routine
     minor: Inappropriate type
HDF5-DIAG: Error detected in HDF5 (1.10.0-patch1) thread 140201515243328:
   #000: ../../../src/H5T.c line 1723 in H5Tclose(): not a datatype
     major: Invalid arguments to routine
     minor: Inappropriate type
Retrieve type information: Close dataset 'Objects'
HDF5-DIAG: Error detected in HDF5 (1.10.0-patch1) thread 140201515243328:
   #000: ../../../src/H5D.c line 334 in H5Dclose(): not a dataset
     major: Invalid arguments to routine
     minor: Inappropriate type
Close HDF5 file
HDF5-DIAG: Error detected in HDF5 (1.10.0-patch1) thread 140201515243328:
   #000: ../../../src/H5F.c line 749 in H5Fclose(): not a file ID
     major: Invalid arguments to routine
     minor: Inappropriate type

As recommended, calling "h5clear -s" did fix the problem, and then
permitted opening of the file.  It would be nice if such a problem was
reported properly by the various tools so that the caller could be
informed of what the problem is.  It would also be nice if HDFView could
explicitly open a file read-only, to avoid any changes being made.

By the way, looking at tools/src/misc/CMakeLists.txt, the h5clear binary
isn't installed.  But it is installed by Makefile.am.  Would it be
possible to correct this so it's installed in all cases?


Thanks,
Roger

--
Dr Roger Leigh -- Open Microscopy Environment
Wellcome Trust Centre for Gene Regulation and Expression,
College of Life Sciences, University of Dundee, Dow Street,
Dundee DD1 5EH Scotland UK   Tel: (01382) 386364

The University of Dundee is a registered Scottish Charity, No: SC015096

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Reply via email to