Corrupted Dataset?

Hey everyone,

I am using HDF5 in Matlab R2008b (also using HDFView software). I believe I may have corrupted a HDF5 file. I am not sure how I corrupted it, and also not sure how to repair. I have file with a grouup /test0/test2. In /test0 there used to be 2 datasets, /test0/test2/Domain and /test0/test2/Range. I can access Domain with no problem. But for some reason, Range is now inaccessible. It also is no longer listed as a dataset object type (see code below). I cannot retrieve any object info from Range. I cannot read or write from Range. And I cannot delete (unlink) it. However, it is listed as an object under /test0/test2.

Is there any way to repair, or just plain remove and replace, 'Range'?

Some sample code and the results are below where I access Domain and Range as dset_1 and dset_2 respectively:

ยทยทยท

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

fid = H5F.open('test.h5','H5F_ACC_RDWR','H5P_DEFAULT')

fid =

67108873

gid = H5G.open(fid,'/test0')

H5G.get_objname_by_idx(gid,1)

ans =

test1

H5G.get_objname_by_idx(gid,2)

ans =

test2

gid_2 = H5G.open(gid, H5G.get_objname_by_idx(gid,2));
dset_1 = H5D.open(gid_2, 'Domain')

dset_1 =

335548435

dset_2 = H5D.open(gid_2, 'Range')

??? Error using ==> H5ML.hdf5>postprocess at 92
An invalid HDF5 identifier was returned from the HDF5 library:
"not a dataset"

Error in ==> H5ML.hdf5 at 36
[varargout{1:nOut}] = postprocess(functionName, varargin, varargout{:});

Error in ==> H5D.open at 19
dataset_id = H5ML.hdf5('H5Dopen', file_id, name);

H5G.get_objname_by_idx(gid_2,0)

ans =

Domain

H5G.get_objname_by_idx(gid_2,1)

ans =

Range

H5G.get_objtype_by_idx(gid_2,0)

ans =

2

H5G.get_objtype_by_idx(gid_2,1)

ans =

-1

H5G.get_objinfo(gid_2,'Domain',-1)

ans =

fileno: [9 0]
objno: [3.8791e+009 14]
nlink: 1
type: 2
mtime: 1.2463e+009
linklen: 0
ohdr: [1x1 struct]

H5G.get_objinfo(gid_2,'Range',-1)

??? Error using ==> H5ML.hdf5 at 25
The HDF5 library encountered an error:
"cannot stat object"

Error in ==> H5G.get_objinfo at 21
statbuf = H5ML.hdf5('H5Gget_objinfo', loc_id, name, follow_link);

dset_2 = H5D.open(gid_2, 'Range')

??? Error using ==> H5ML.hdf5>postprocess at 92
An invalid HDF5 identifier was returned from the HDF5 library:
"not a dataset"

Error in ==> H5ML.hdf5 at 36
[varargout{1:nOut}] = postprocess(functionName, varargin, varargout{:});

Error in ==> H5D.open at 19
dataset_id = H5ML.hdf5('H5Dopen', file_id, name);

sID = H5S.create_simple(1, 1, []);
dsetID = H5D.create(gid_2, 'Range', 'H5T_NATIVE_DOUBLE', sID, 'H5P_DEFAULT');

??? Error using ==> H5ML.hdf5>postprocess at 92
An invalid HDF5 identifier was returned from the HDF5 library:
"unable to create dataset"

Error in ==> H5ML.hdf5 at 36
[varargout{1:nOut}] = postprocess(functionName, varargin, varargout{:});

Error in ==> H5D.create at 21

dsetID = H5D.create(gid_2, 'Range_2', 'H5T_NATIVE_DOUBLE', sID, 'H5P_DEFAULT');
H5D.close(dsetID)
H5G.unlink(gid_2, 'Range_2')
H5G.unlink(gid_2, 'Range')

??? Error using ==> H5ML.hdf5 at 25
The HDF5 library encountered an error:
"unable to unlink object"

Error in ==> H5G.unlink at 19
H5ML.hdf5('H5Gunlink', loc_id, name);