Can we able to create the HDF (h5) file in our local folder

Hi Team,

Currently the HDF5 Datafile (h5) what we are creating by using the Code,
eg : HDFql.Execute(“CREATE FILE Sample.h5”);

Is directly created in the root folder of our solution and now we want to create the Same HDF5 Datafile (h5) in my local folder where ever we wish by using the file path or however it is.

Is it possible? If it is possible please kindly let us know how to do in the Code.

Thanks in advance.

Hi @leelakrishna.k,

Yes, it is possible to create an HDF5 file in another location than the current working directory - just specify this location along with the HDF5 file you wish to create. Example:

// create HDF5 file 'test.h5' in directory '/home/joe/data'
HDFql.Execute("CREATE FILE /home/joe/data/test.h5");

Hope it helps!

Hi again @leelakrishna.k,

Another alternative would be to set the current working directory to the location you have in mind and then create the HDF5 file without specify this location. Example:

// set current working directory to '/home/joe/data'
HDFql.Execute("USE DIRECTORY /home/joe/data");

// create HDF5 file 'test.h5' in current working directory
HDFql.Execute("CREATE FILE test.h5");

Hope it helps!

Hello Team,

We tried in the sample with your Code in the similar way.Actually i want to Save my HDF5 file in my local (/:D) Drive in the folder called ‘HDFql’.

For that i’m using the following Code;

HDFql.Execute(“USE DIRECTORY /D:/HDFql”);

            HDFql.Execute("CREATE FILE  WriteHDFql7.h5");

            HDFql.Execute("USE FILE WriteHDFql7.h5"); 

But i’m not able to see the file WriteHDFql7.h5 created in my (:D) drive folder.

Please let us know if we are missing anything in the Code or do we need to add anything else here.

Thanks,
Leelakrishna

Hi @leelakrishna.k,

Because the location you want to use as the current working directory contains a reserved keyword (i.e. :), this location should be surrounded with ". Therefore, the HDFql statement that sets the current working directory should look like the following:

HDFql.Execute("USE DIRECTORY \"D:\HDFql\"");

Hope it helps!

Hi Team,

Thank you much for the solution it really helped us which is working fine.

Thanks,
Leelakrishna

1 Like