Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a93efad

Browse files
committed
Add H5Pget_virtual_filename()
1 parent d295f56 commit a93efad

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

h5py/api_functions.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ hdf5:
309309
herr_t H5Pset_szip(hid_t plist, unsigned int options_mask, unsigned int pixels_per_block)
310310
herr_t H5Pset_scaleoffset(hid_t plist, H5Z_SO_scale_type_t scale_type, int scale_factor)
311311
1.9.233 ssize_t H5Pget_virtual_dsetname(hid_t dcpl_id, size_t index, char *name, size_t size)
312+
1.9.233 ssize_t H5Pget_virtual_filename(hid_t dcpl_id, size_t index, char *name, size_t size)
312313

313314
# Dataset access
314315
herr_t H5Pset_edc_check(hid_t plist, H5Z_EDC_t check)

h5py/h5p.pyx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,26 @@ cdef class PropDCID(PropOCID):
809809

810810
return src_dset_name
811811

812+
@with_phil
813+
def get_virtual_filename(self, size_t index=0):
814+
"""(UINT index=0) => STR
815+
816+
Get the file name of a source dataset used in the mapping of the
817+
virtual dataset at the position index.
818+
"""
819+
cdef char* name = NULL
820+
cdef ssize_t size
821+
822+
size = H5Pget_virtual_dsetname(self.id, index, NULL, 0)
823+
name = <char*>emalloc(size+1)
824+
try:
825+
H5Pget_virtual_filename(self.id, index, name, <size_t>size+1)
826+
src_fname = name
827+
finally:
828+
efree(name)
829+
830+
return src_fname
831+
812832
# File access
813833
cdef class PropFAID(PropInstanceID):
814834

0 commit comments

Comments
 (0)