Skip to content
Snippets Groups Projects
Commit 2521ebe1 authored by Robert Klöfkorn's avatar Robert Klöfkorn
Browse files

Added check if file exists.

[[Imported from SVN: r1768]]
parent 5f633ac0
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,12 @@ namespace Dune {
const char keywd[], T & data, bool verbose = true)
{
std::fstream file (filename,std::ios::in);
if( !file )
{
std::cerr << "ERROR: cannot open file '" << filename << "' in " << __FILE__<< " line: " << __LINE__ << std::endl;
DUNE_THROW(IOError,"cannot open file " << filename << std::endl);
}
std::basic_string<char> keyword ( keywd );
bool readData = false;
char ch[1024];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment