Commit 52bc274b authored by mattijs's avatar mattijs
Browse files

ENH: writeFile: check for opening status. Fixes #783.

parent df97bd27
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -114,6 +114,12 @@ Foam::autoPtr<Foam::OFstream> Foam::functionObjects::writeFile::createFile
osPtr.reset(new OFstream(outputDir/(fName + ".dat")));
if (!osPtr->good())
{
FatalIOErrorInFunction(osPtr()) << "Cannot open file"
<< exit(FatalIOError);
}
initStream(osPtr());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment