MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / OpenFileForWriting

Function OpenFileForWriting

tests/gtest/gtest-all.cc:1665–1677  ·  view source on GitHub ↗

Utilty function to Open File for Writing

Source from the content-addressed store, hash-verified

1663
1664// Utilty function to Open File for Writing
1665static FILE* OpenFileForWriting(const std::string& output_file) {
1666 FILE* fileout = nullptr;
1667 FilePath output_file_path(output_file);
1668 FilePath output_dir(output_file_path.RemoveFileName());
1669
1670 if (output_dir.CreateDirectoriesRecursively()) {
1671 fileout = posix::FOpen(output_file.c_str(), "w");
1672 }
1673 if (fileout == nullptr) {
1674 GTEST_LOG_(FATAL) << "Unable to open file \"" << output_file << "\"";
1675 }
1676 return fileout;
1677}
1678
1679} // namespace internal
1680

Callers 2

OnTestIterationEndMethod · 0.85

Calls 3

FOpenFunction · 0.85
RemoveFileNameMethod · 0.80

Tested by

no test coverage detected