I am pretty certain it CANNOT do that.

On read, the core vfd will open the named file, allocate a buffer large
enough for it (modulo allocation inc) and read its entire contents into
that buffer.

However, it shouldn't be too hard to enhance H5FDcore.c to do what you
need. I don't know if that driver is written with or without knowledge
of HDF5 library 'private' stuff.

If it does NOT use HDF5 private stuff, then copy H5FDcore.c to your own
source tree, replace the names of all the functions to something
different like H5FD_mycore_<whatever> and then add an argument to the
set_fapl method for void *buf. In the open method, examine that property
and if its non-null, skip the alloc and read and just set the file
pointer's buf member to whatever buffer address was passed in the
set_fapl. Then, in your application call H5Pset_fapl_mycore(alloc,
back_store, buf); where 'buf' is the 'image' you've allocated. Compile
H5FDmycore.c into your application.

If the H5FDcore.c uses HDF5 private stuff, then its more work to do this
because it can't compile easily outside HDF5's source code tree.


Mark



On Thu, 2010-03-25 at 11:49, Andrew Collette wrote:
> Hi,
> 
> Does anyone know if it's possible to open a "file" with the CORE
> driver from e.g. an existing malloc'ed buffer containing the image of
> an HDF5 file?
> 
> Thanks,
> Andrew Collette
> 
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> [email protected]
> http://*mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
-- 
Mark C. Miller, Lawrence Livermore National Laboratory
================!!LLNL BUSINESS ONLY!!================
[email protected]      urgent: [email protected]
T:8-6 (925)-423-5901     M/W/Th:7-12,2-7 (530)-753-851


_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to