MCPcopy Create free account
hub / github.com/PiSCSI/piscsi / OpenTempFile

Function OpenTempFile

cpp/test/test_shared.cpp:68–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68pair<int, path> OpenTempFile()
69{
70 const string filename =
71 string(test_data_temp_path) + "/piscsi_test-XXXXXX"; // NOSONAR Publicly writable directory is fine here
72 vector<char> f(filename.begin(), filename.end());
73 f.push_back(0);
74
75 create_directories(path(filename).parent_path());
76
77 const int fd = mkstemp(f.data());
78 EXPECT_NE(-1, fd) << "Couldn't create temporary file '" << f.data() << "'";
79
80 return make_pair(fd, path(f.data()));
81}
82
83path CreateTempFile(int size)
84{

Callers 2

CreateTempFileWithDataFunction · 0.85
TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected