MCPcopy Create free account
hub / github.com/crownengine/crown / open

Method open

3rdparty/bx/src/process.cpp:39–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 }
38
39 bool ProcessReader::open(const FilePath& _filePath, const StringView& _args, Error* _err)
40 {
41 BX_ASSERT(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
42
43 if (NULL != m_file)
44 {
45 BX_ERROR_SET(_err, kErrorReaderWriterAlreadyOpen, "ProcessReader: File is already open.");
46 return false;
47 }
48
49 char tmp[kMaxFilePath*2] = "\"";
50 strCat(tmp, BX_COUNTOF(tmp), _filePath);
51 strCat(tmp, BX_COUNTOF(tmp), "\" ");
52 strCat(tmp, BX_COUNTOF(tmp), _args);
53
54 m_file = popen(tmp, "r");
55 if (NULL == m_file)
56 {
57 BX_ERROR_SET(_err, kErrorReaderWriterOpen, "ProcessReader: Failed to open process.");
58 return false;
59 }
60
61 return true;
62 }
63
64 void ProcessReader::close()
65 {

Callers

nothing calls this directly

Calls 2

strCatFunction · 0.85
popenFunction · 0.85

Tested by

no test coverage detected