diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-02-26 18:05:27 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-02-26 18:05:27 (GMT) |
commit | f82fc6b33dfd1f752183330e61807ab94ef2c6b7 (patch) | |
tree | 0e6f60c5435c8791ca4ecbb0549f72f7c6bb184b /src/H5G.c | |
parent | ad73f18f5e759c4bd3d12c331659a24b54d0c39a (diff) | |
download | hdf5-f82fc6b33dfd1f752183330e61807ab94ef2c6b7.zip hdf5-f82fc6b33dfd1f752183330e61807ab94ef2c6b7.tar.gz hdf5-f82fc6b33dfd1f752183330e61807ab94ef2c6b7.tar.bz2 |
[svn-r299] Changes since 19980224
----------------------
./html/Files.html
Added a few details for some of the new H5Pset/get functions.
./src/H5F.c
./src/H5Fpublic.h
Fixed automatic closing of files on exit().
Added public H5F_ACC_DEBUG. Using it to create or open a file
turns on debugging for that file, which currently just prints
cache statistics when the file is closed.
./src/H5G.c
An error is returned if one tries to set the current working
group to something other than a group.
./src/H5Gnode.c
Fixed a symbol table bug. Under certain circumstances it was
possible to enter a symbol in such a way that lookup of that
symbol failed. A bug report was sent to hdf5dev.
./src/H5P.c
./src/H5Ppublic.h
Added the H5Pget_...() functions for file drivers. The
H5Pget_mpi() is a no-op that always fails.
Diffstat (limited to 'src/H5G.c')
-rw-r--r-- | src/H5G.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -834,11 +834,12 @@ H5G_create(H5F_t *f, const char *name, size_t size_hint) * *------------------------------------------------------------------------- */ -H5G_t * +H5G_t * H5G_open(H5F_t *f, const char *name) { - H5G_t *grp = NULL; - H5G_t *ret_value = NULL; + H5G_t *grp = NULL; + H5G_t *ret_value = NULL; + H5O_stab_t mesg; FUNC_ENTER(H5G_open, NULL); @@ -846,7 +847,7 @@ H5G_open(H5F_t *f, const char *name) assert(f); assert(name && *name); - /* Open the group */ + /* Open the object, making sure it's a group */ grp = H5MM_xcalloc(1, sizeof(H5G_t)); if (H5G_find(f, name, NULL, &(grp->ent)) < 0) { HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "group not found"); @@ -854,6 +855,10 @@ H5G_open(H5F_t *f, const char *name) if (H5O_open(f, &(grp->ent)) < 0) { HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to open group"); } + if (NULL==H5O_read (&(grp->ent), H5O_STAB, 0, &mesg)) { + H5O_close (&(grp->ent)); + HGOTO_ERROR (H5E_SYM, H5E_CANTOPENOBJ, NULL, "not a group"); + } grp->nref = 1; ret_value = grp; |