Hi Dana, Setting the plugin path programmatically will be very useful for those applications that bundle filters too as this will simplify their installation procedure.
Regards, Peter -----Original Message----- From: Hdf-forum [mailto:[email protected]] On Behalf Of Dana Robinson Sent: 03 March 2017 15:58 To: HDF Users Discussion List <[email protected]> Subject: Re: [Hdf-forum] Setting plugin path programmatically Hi Andrey, I'll create an issue for this. We have a Windows layer that substitutes Win32 equivalents for some POSIX commands and it should be straightforward to use SetEnvironmentVariable() on Windows. Dana Robinson Software Engineer The HDF Group -----Original Message----- From: Hdf-forum [mailto:[email protected]] On Behalf Of ?????? ????????? Sent: Friday, March 3, 2017 3:43 AM To: HDF Users Discussion List <[email protected]> Subject: [Hdf-forum] Setting plugin path programmatically Hello! My usage scenario is a big Windows application with a lot of dlls, some of which use HDF5 library. HDF5 code uses Dynamically Loaded Plugin Filters: https://support.hdfgroup.org/HDF5/doc1.8/Advanced/DynamicallyLoadedFilters/HDF5DynamicallyLoadedFilters.pdf The filters are deployed in a local directory which is activated via modifying process HDF5_PLUGIN_PATH env.variable, just prior to loading the library. That works fine, and important thing is that user can just drop new plugins in that directory to support newer files. However, it appears that in some cases plugin search fails. HDF5 library retrieves HDF5_PLUGIN_PATH via HDgetenv which is defined as #define HDgetenv(S) getenv(S) According to http://stackoverflow.com/questions/10636768/does-getenv-cache-the-result/10636993#10636993 "A process inherits the environment from the process creating the new process. This is held in memory." In the application I do not use C runtime (the implementation language is not C), so I use SetEnvironmentVariable: https://msdn.microsoft.com/ru-ru/library/windows/desktop/ms686206(v=vs.85).aspx It appears that if I modify HDF5_PLUGIN_PATH before C runtime is loaded for the first time in the application, all is fine. However if I call SetEnvironmentVariable after C runtime is already loaded, it has no effect for HDF5. The application is huge, and it's very hard to control the moments C runtime and HDF5 library are loaded. I wonder -- does it make sense to add HDF5 procedures to verbosely modify plugin search path, something like herr_t H5PLadd_path(const char *name) herr_t H5PLrem_path(const char *name) ? The above procedures could use HDsetenv, which is otherwise not accessible (from non-C applications). (I think similar motivation led to exposing H5free_memory procedure.) What do you think? Best wishes, Andrey Paramonov -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5 _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5 -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5
