MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / AppendStringToFile

Function AppendStringToFile

tensorflow/core/kernels/logging_ops.cc:39–49  ·  view source on GitHub ↗

Appends the given data to the specified file. It will create the file if it doesn't already exist.

Source from the content-addressed store, hash-verified

37// Appends the given data to the specified file. It will create the file if it
38// doesn't already exist.
39Status AppendStringToFile(const std::string& fname, StringPiece data,
40 Env* env) {
41 // TODO(ckluk): If opening and closing on every log causes performance issues,
42 // we can reimplement using reference counters.
43 mutex_lock l(*file_mutex);
44 std::unique_ptr<WritableFile> file;
45 TF_RETURN_IF_ERROR(env->NewAppendableFile(fname, &file));
46 Status a = file->Append(data);
47 Status c = file->Close();
48 return a.ok() ? c : a;
49}
50
51} // namespace
52

Callers 1

ComputeMethod · 0.85

Calls 4

NewAppendableFileMethod · 0.45
AppendMethod · 0.45
CloseMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected