Can HDF5 be connected to formatted data?

Is it possible to write HDF5 to stdout and read from stdin (via H5::File file("/dev/stdout",H5F_ACC_RDONLY)

or otherwise)?


I want a program to foo

write to an HDF5 file (considered by its first argument, say) and another program bar

to read from an HDF5 file, and then instead of

command_prompt> foo temp.h5
command_prompt> bar temp.h5
command_prompt> rm temp.h5

      

just tell

command_prompt> foo - | bar -

      

where programs foo

and bar

understand that the special file name -

means stdout

and, stdin

respectively. To write these programs, I want to know: 1) is it possible, and 2) how I implement it, that is, what should be passed to H5Fcreate()

and H5Fopen()

, accordingly, in the case of filename = -

.


I have tried and it seems impossible (not a big surprise). HDF5 only has H5Fcreate()

, H5Fopen()

and H5Freopen()

none of which seems to support I / O before stdin/stdout

.

+3


source to share


1 answer


I dont think you can use stdin

hdf5 as input file. The library needs to search between header content and data, and you can't do that with stdin

.



+1


source







All Articles