getting back the _full_ (with path) filename from a hid_t

Hello,
I need to get back the complete filename from an opened hdf5 file.
H5Fget_name() only gives me the 'basename' filename component that was used to
H5Fcreate() the file.
However the current working directory have changed since then :frowning: .
Of course, hdf5 has all the needed info as it must hold a handle on
the file, but how can I get access to it ?
I saw nothing of help in H5F: File Interface [0], have I looked at the
wrong place ?

Any clue greatly appreciated.

Best Regards,

Bernard

[0] http://ftp.hdfgroup.org/HDF5/doc/RM/RM_H5F.html

Bernard,

You can try H5Fget_vfd_handle. It takes a void**, which should be the address of a pointer to a file handle. Depending on the file driver used, the file handle will be of a different type. Using the sec2 driver or windows without WINDOWS_USE_STDIO (which is the default), you should declare an int *(call it int *fd), and pass the argument as (void**)&fd. Using the stdio driver or windows with WINDOWS_USE_STDIO, you should declare a FILE **fp, and pass the argument as (void **)&fp.

Thanks,
-Neil

···

On 06/22/2010 09:04 AM, Bernard Hugueney wrote:

  Hello,
I need to get back the complete filename from an opened hdf5 file.
H5Fget_name() only gives me the 'basename' filename component that was used to
H5Fcreate() the file.
However the current working directory have changed since then :frowning: .
Of course, hdf5 has all the needed info as it must hold a handle on
the file, but how can I get access to it ?
I saw nothing of help in H5F: File Interface [0], have I looked at the
wrong place ?

Any clue greatly appreciated.

Best Regards,

Bernard

[0] http://ftp.hdfgroup.org/HDF5/doc/RM/RM_H5F.html

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org