VOL-REST: H5Fget_filesize()


The other day, I got a request to implement functionality to retrieve the file size of HDF5 file via the library we have written on top of the HDF5 library. Fortunately, HDF5 library provides the function H5Fget_size() so it is almost trivial for use to implement this. However, when I look at VOL-REST implementation it seems like this function is not supported. Is this true? And if so, would it be possible to add it or does it make no sense to have such a function in the context of REST?

Best regards,

1 Like

HSDS stores data in a sharded way i.e. each metadata object and chunk is a file (or object with S3), but saying that H5Fget_size() should return the sum of all the objects would seem like a sensible thing to do.

That functionality is already in HSDS. If you run hsstat, it will give you the total size of the domain.

But, I’m not sure if H5Fget_size() is plumbed through the VOL interface or not. Matt, can you answer this?

H5Fget_filesize is accessible through the VOL interface. It’s not currently implemented, but like John said, iterating through existing objects should be fairly straightforward. This will likely cause it to be somewhat slow, similar to H5Dget_storage_size, but it should be fine for occasional utility usage. I’ve added it to the list of requested features on Github.

Hello @jreadey and @mlarson,

Thanks for the information. Good to know that HSDS already supports this. Actually, I should have known it because I have used hsstat in the past.

Thanks for putting this feature on the list of requested feature. For me it is not a problem if the function is somewhat slow.