MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / checkWrite

Function checkWrite

src/OpenFOAM/db/IOstreams/Fstreams/masterOFstream.C:35–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
34
35void Foam::masterOFstream::checkWrite
36(
37 const fileName& fName,
38 const string& str
39)
40{
41 mkDir(fName.path());
42
43 OFstream os
44 (
45 fName,
46 IOstream::BINARY,
47 version(),
48 compression_,
49 append_
50 );
51
52 if (!os.good())
53 {
54 FatalIOErrorInFunction(os)
55 << "Could not open file " << fName
56 << exit(FatalIOError);
57 }
58
59 os.writeQuoted(str, false);
60 if (!os.good())
61 {
62 FatalIOErrorInFunction(os)
63 << "Failed writing to " << fName
64 << exit(FatalIOError);
65 }
66}
67
68
69// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

Callers 1

masterOFstream.CFile · 0.85

Calls 4

mkDirFunction · 0.50
exitFunction · 0.50
pathMethod · 0.45
goodMethod · 0.45

Tested by

no test coverage detected