Skip to content
Snippets Groups Projects
Commit 52bc274b authored by mattijs's avatar mattijs
Browse files

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

parent df97bd27
No related branches found
No related tags found
No related merge requests found
......@@ -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());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment