mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: writeFile: check for opening status. Fixes #783.
This commit is contained in:
@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user