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

Andrew Janke a.janke at gmail.com
Thu Jan 13 11:20:31 EST 2011


Hi Rick,

> 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);

My understanding is that this is always going to be a problem with a
MINC NetCDF file and likely HDF too. NetCDF has a "define" (set file
dimensions, type, etc) and a "data" mode (other headers, the data
itself). These two modes sort of preclude you merrily redirecting MINC
files around with pipes.


a


More information about the MINC-development mailing list