- // use MEDCOUPLING_ROOT_DIR env.var
- resourceFile = getenv("MEDCOUPLING_ROOT_DIR");
- resourceFile += "/share/resources/med/";
- resourceFile += filename;
- std::ifstream my_file(resourceFile);
- if (my_file.good())
- good = true;
+ // use MEDCOUPLING_ROOT_DIR env.var
+ resourceFile = getenv("MEDCOUPLING_ROOT_DIR");
+ resourceFile += "/share/resources/med/";
+ resourceFile += filename;
+ std::ifstream my_file(resourceFile.c_str());
+ if (my_file.good())
+ return resourceFile;
+ }
+ if ( getenv("MEDCOUPLING_RESOURCE_DIR") ) {
+ // use MEDCOUPLING_RESOURCE_DIR env.var
+ resourceFile = getenv("MEDCOUPLING_RESOURCE_DIR");
+ resourceFile.erase(std::remove(resourceFile.begin(), resourceFile.end(), ':'), resourceFile.end());
+ resourceFile += "/";
+ resourceFile += filename;
+ std::ifstream my_file(resourceFile.c_str());
+ if (my_file.good())
+ return resourceFile;