MCPcopy Create free account
hub / github.com/Singular/Singular / ReadProcess

Function ReadProcess

ppcc/adlib/os.cc:116–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116Str *ReadProcess(Str *prog, StrArr *args) {
117 Str *command = BuildCommand(prog, args);
118 FILE *pipe = popen(command->c_str(), "r");
119 if (!pipe)
120 return NULL;
121 Str *result = ReadFile(pipe);
122 if (pclose(pipe))
123 return NULL;
124 return result;
125}
126
127StrArr *ReadProcessLines(Str *prog, StrArr *args) {
128 Str *output = ReadProcess(prog, args);

Callers 3

MainFunction · 0.85
ReadProcessLinesFunction · 0.85
RunCPPFunction · 0.85

Calls 3

BuildCommandFunction · 0.85
ReadFileFunction · 0.85
c_strMethod · 0.80

Tested by 1

MainFunction · 0.68