HDFGroup / HDF.PInvoke

Raw HDF5 Power for .NET
http://www.hdfgroup.org/HDF5
Other
80 stars 29 forks source link

Question: Call to list all open objects and how to close all of them? #18 #169

Closed LiorBanai closed 2 years ago

LiorBanai commented 3 years ago

Hi,

is there are method that list all opens objects with its information? can those be close in other call or they need to be closed individually?

JanWosnitza commented 3 years ago

Hello @LiorBanai, if it's only about closing all objects, you could create a Property, set it to close-strong and give it to H5Fopen.

Something along these lines (untested):

var property = H5P.create(H5P.FILE_ACCESS);
H5P.set_fclose_degree(property, H5F.close_degree_t.STRONG);
var file = H5F.open("FILE_NAME", H5F.ACC_RDWR, property);
H5P.close(property);

// access file

H5F.close(file); // All open objects remaining in the file are closed then file is closed

also have a look at the c documentation: H5Pset_fclose_degree

LiorBanai commented 3 years ago

Thanks @JanWosnitza , I'll check this out