| 33 | // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // |
| 34 | |
| 35 | void 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 * * * * * * * * * * * * * * // |
no test coverage detected