MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / setFile

Method setFile

DEVELOPER/core/StandardStream.cpp:49–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49int
50StandardStream::setFile(const char *fileName, openMode mode, bool echo)
51{
52 if (fileOpen == 1) {
53 theFile.close();
54 fileOpen = 0;
55 }
56
57 if (mode == OVERWRITE)
58 theFile.open(fileName, ios::out);
59 else
60 theFile.open(fileName, ios::out| ios::app);
61
62 if (theFile.bad()) {
63 std::cerr << "WARNING - StandardStream::setFile()";
64 std::cerr << " - could not open file " << fileName << std::endl;
65
66 return -1;
67 } else
68 fileOpen = 1;
69
70 echoApplication = echo;
71
72 return 0;
73}
74
75
76int

Callers

nothing calls this directly

Calls 2

closeMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected