+std::ifstream* surf_ifsopen(const char* name)
+{
+ std::ifstream* fs = new std::ifstream();
+ xbt_assert(name);
+ if (__surf_is_absolute_file_path(name)) { /* don't mess with absolute file names */
+ fs->open(name, std::ifstream::in);
+ }
+
+ /* search relative files in the path */
+ for (auto path_elm : surf_path) {
+ std::string buff = path_elm + FILE_DELIM + name;
+ fs->open(buff.c_str(), std::ifstream::in);
+
+ if (!fs->fail()) {
+ XBT_DEBUG("Found file at %s", buff.c_str());
+ return fs;
+ }
+ }
+
+ return fs;
+}