From: Martin Quinson Date: Mon, 31 Dec 2018 17:38:16 +0000 (+0100) Subject: improve an error message when a file cannot be open X-Git-Tag: v3_22~727 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/40d5d53c5e12dced0b6b8c4f852ef104e8857493 improve an error message when a file cannot be open --- diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/surf/xml/surfxml_sax_cb.cpp index 1b920ef2a5..9b294a43c0 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -968,10 +968,11 @@ void surf_parse_open(std::string file) surf_parsed_filename = file; std::string dir = simgrid::xbt::Path(file).get_dir_name(); surf_path.push_back(dir); + std::string cwd = simgrid::xbt::Path().get_dir_name(); surf_file_to_parse = surf_fopen(file, "r"); if (surf_file_to_parse == nullptr) - xbt_die("Unable to open '%s'\n", file.c_str()); + xbt_die("Unable to open '%s' from '%s'\n", file.c_str(), cwd.c_str()); surf_input_buffer = surf_parse__create_buffer(surf_file_to_parse, YY_BUF_SIZE); surf_parse__switch_to_buffer(surf_input_buffer); surf_parse_lineno = 1;