H5 file directory

Hi, HDF Experts,

H5Fcreate creates a new file named name in the *current directory.*

*How to create a HDF file in another directory?*

*How to specify a directory for a H5 file when calling H5Fopen?*

Thanks in advance for any help!

JC

···

______________________________________________________
Jianxin Chen

Just pass in a full path for the H5Fcreate’s ‘name’ parameter.

···

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of Jianxin Chen
Sent: Monday, July 13, 2015 1:54 PM
To: HDF Users Discussion List
Subject: [Hdf-forum] H5 file directory

Hi, HDF Experts,

H5Fcreate creates a new file named name in the current directory.

How to create a HDF file in another directory?

How to specify a directory for a H5 file when calling H5Fopen?

Thanks in advance for any help!

JC
______________________________________________________
Jianxin Chen

________________________________

This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender. Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of Exelis Inc. The recipient should check this e-mail and any attachments for the presence of viruses. Exelis Inc. accepts no liability for any damage caused by any virus transmitted by this e-mail.

Normally, I would expect H5Fopen/creat calls to do same as thier posix equivalents.

I went looking through posix man pages for exactly how either open or creat form the 'path' of the file.

Surely, if you pass "foo.h5", it will create "foo.h5" in $CWD of the process.

And, as another respondent mentioned, if you pass a full path, it will create/open the file at that full path.

But, what if you pass "../bar/foo.h5"? will posix create the file in a dir named 'bar' that is one level up from $CWD? I don't know and I couldn't find refs on the system I was on that actually explain/define that behavior?

I think for anything other than a file in $CWD, might need to write a tiny bit of code that takes whatever path you are starting with and then uses get_cwd() and 'joins' the path you are given to form an absolute path to actually open.

HTH.

Mark

···

From: Jianxin Chen <jianxinc@gmail.com<mailto:jianxinc@gmail.com>>
Reply-To: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Date: Monday, July 13, 2015 10:54 AM
To: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Subject: [Hdf-forum] H5 file directory

Hi, HDF Experts,

H5Fcreate creates a new file named name in the current directory.

How to create a HDF file in another directory?

How to specify a directory for a H5 file when calling H5Fopen?

Thanks in advance for any help!

JC
______________________________________________________
Jianxin Chen