[MINC-development] Opening MINC2 HDF5 file from /dev/fd/ file descriptor

Rick Hoge rick.hoge at linev.ca
Tue Jan 11 23:43:55 EST 2011


Hi -

I have some code that gunzips a compressed MINC file, sending the uncompressed result to stdout.  I connect stdout of the gunzip process to a pipe which is mapped to the device /dev/df/n where 'n' is the POSIX file descriptor.

This has worked in the past for other file formats, where I could access the data like this:

FILE *fptr = fopen("/dev/fd/12","r"); // Assuming the file descriptor is 12
// Load data from file
fclose(fptr);

For some reason, miopen_volume() does not like these file descriptor handles.  Is there any simple to way to read a MINC2 file from stdin or a stream?

For this application I can just create a temp file and clean it up after reading, but I'm still wondering if it's possible to do this type of thing using /dev/fd/.  I'd heard that HDF5 supports reading from streams.

Thanks for any info,

Rick




More information about the MINC-development mailing list