MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / NamedTemporaryFile

Method NamedTemporaryFile

test/src/helper.cpp:253–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251#endif
252
253NamedTemporaryFile::NamedTemporaryFile() {
254 char name[256];
255 strcpy(name, output_file("mgb-test-XXXXXX", false).c_str());
256 m_fd = mkstemp(name);
257 mgb_throw_if(m_fd == -1, MegBrainError, "failed to open temp file `%s': %m", name);
258 m_fpath = name;
259 mgb_log_debug("opened temporary file: %s", name);
260}
261
262NamedTemporaryFile::~NamedTemporaryFile() {
263#ifdef WIN32

Callers 2

_write_elemwise_modesMethod · 0.80
process_fileFunction · 0.80

Calls 2

output_fileFunction · 0.85
mkstempFunction · 0.70

Tested by

no test coverage detected