Hi Rafal, I am able to create a dataset with zero dimensions, close it, and re-open. (See attached). Can you send us an example of what you are trying that fails? Please send it to the helpdesk: h...@hdfgroup.org
Thanks! -Barbara h...@hdfgroup.org -----Original Message----- From: Hdf-forum [mailto:hdf-forum-boun...@lists.hdfgroup.org] On Behalf Of Gerd Heber Sent: Thursday, October 26, 2017 6:49 AM To: HDF Users Discussion List Subject: Re: [Hdf-forum] HDF5 library bug or feature? >> Rafal, this might be a bug. > Is there any way to record/track this issue? Not sure. Helpdesk will check. (It's still early morning here...) G. _______________________________________________ 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
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * * root level of an installed copy of the electronic HDF5 document set and * * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from h...@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * This example illustrates how to create a dataset that is a 4 x 6 * array. It is used in the HDF5 Tutorial. */ #include "hdf5.h" #define FILE "rafal.h5" int main() { hid_t file_id, dataset_id, dataspace_id; /* identifiers */ hsize_t dims[2]; herr_t status; /* Create a new file using default properties. */ if ((file_id = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) printf ("H5Fcreate Failed!\n"); else printf ("H5Fcreate: OK\n"); /* Create the data space for the dataset. */ dims[0] = 0; dims[1] = 0; if ((dataspace_id = H5Screate_simple(2, dims, NULL)) < 0) printf ("H5Screate_simple fails!\n"); else printf ("H5Screate_simple: OK\n"); /* Create the dataset. */ if ((dataset_id = H5Dcreate2(file_id, "/dset", H5T_STD_I32BE, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) printf ("H5Dcreate2 Failed!\n"); else printf ("H5Dcreate2: OK\n"); /* End access to the dataset and release resources used by it. */ if ((status = H5Dclose(dataset_id)) < 0) printf ("H5Dclose Failed!\n"); else printf ("H5Dclose: OK\n"); if ((status = H5Sclose(dataspace_id)) < 0) printf ("H5Sclose Failed!\n"); else printf ("H5Sclose: OK\n"); if ((status = H5Fclose(file_id)) < 0) printf ("H5Fclose Failed!\n"); else printf ("H5Fclose: OK\n"); if ((file_id = H5Fopen (FILE, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) printf ("H5Fopen Failed!\n"); else printf ("H5Fopen: OK\n"); if ((dataset_id = H5Dopen2(file_id, "/dset", H5P_DEFAULT)) < 0) printf ("H5Dopen2 Failed!\n"); else printf ("H5Dopen2: OK\n"); if ((dataspace_id = H5Dget_space (dataset_id)) < 0) printf ("H5Dget_space Failed!\n"); else printf ("H5Dget_space: OK\n"); if ((status = H5Dclose(dataset_id)) < 0) printf ("H5Dclose Failed!\n"); else printf ("H5Dclose: OK\n"); /* Terminate access to the data space. */ if ((status = H5Sclose(dataspace_id)) < 0) printf ("H5Sclose Failed!\n"); else printf ("H5Sclose: OK\n"); /* Close the file. */ if ((status = H5Fclose(file_id)) < 0) printf ("H5Fclose Failed!\n"); else printf ("H5Fclose: OK\n"); }
_______________________________________________ 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