MCPcopy Create free account
hub / github.com/apache/singa / SetDestFilePath

Method SetDestFilePath

src/utils/channel.cc:64–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void Channel::SetDestFilePath(const std::string& file) {
65 // file is append only
66 if (os_.is_open()) os_.close();
67 {
68 std::ifstream fin(file.c_str());
69 if (fin.good())
70 LOG(WARNING) << "Messages will be appended to an existed file: " << file;
71 }
72 os_.open(file.c_str(), std::ios::app);
73 if (os_.is_open() == false)
74 LOG(WARNING) << "Cannot open channel file (" << file << ")";
75}
76
77void Channel::Send(const std::string& message) {
78 if (stderr_) fprintf(stderr, "%s\n", message.c_str());

Callers 1

GetInstanceMethod · 0.80

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected