MCPcopy Create free account
hub / github.com/devosoft/avida / Open

Method Open

avida-core/source/tools/cFile.cc:32–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31
32bool cFile::Open(cString _fname, ios::openmode flags)
33{
34 if (IsOpen()) Close(); // If a file is already open, clost it first.
35 fp.open(_fname, flags); // Open the new file.
36
37 // Test if there was an error, and if so, try again!
38 if (fp.fail()) {
39 fp.clear();
40 fp.open(_fname, flags);
41 }
42
43 if (fp.fail()) return false;
44
45 m_openmode = flags;
46 filename = _fname;
47 is_open = true;
48
49 // Return true only if there were no problems...
50 return (fp.good() && !fp.fail());
51}
52
53bool cFile::Close()
54{

Callers 15

mainFunction · 0.80
InitWithDirectoryMethod · 0.80
WriteInstSetFunction · 0.80
WriteDefaultConfigFunction · 0.80
WriteDefaultGenomeFunction · 0.80
WriteExamplePopulationFunction · 0.80
SaveConfigFunction · 0.80
SavePopulationFunction · 0.80
FreezerMethod · 0.80
SaveConfigMethod · 0.80
SaveGenomeMethod · 0.80
SaveWorldMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected