MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / OpenFileForWriting

Function OpenFileForWriting

tests/gtest/src/gtest.cc:181–193  ·  view source on GitHub ↗

Utilty function to Open File for Writing

Source from the content-addressed store, hash-verified

179
180// Utilty function to Open File for Writing
181static FILE* OpenFileForWriting(const std::string& output_file) {
182 FILE* fileout = nullptr;
183 FilePath output_file_path(output_file);
184 FilePath output_dir(output_file_path.RemoveFileName());
185
186 if (output_dir.CreateDirectoriesRecursively()) {
187 fileout = posix::FOpen(output_file.c_str(), "w");
188 }
189 if (fileout == nullptr) {
190 GTEST_LOG_(FATAL) << "Unable to open file \"" << output_file << "\"";
191 }
192 return fileout;
193}
194
195} // namespace internal
196

Callers 2

OnTestIterationEndMethod · 0.70

Calls 4

FOpenFunction · 0.50
RemoveFileNameMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected