MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / command_exists

Function command_exists

Src/Base/AMReX_BLBackTrace.cpp:185–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183
184#ifdef __linux__
185 bool command_exists(std::string const &cmd)
186 {
187 // command -v is part of POSIX so should be available
188 std::string check_command = "command -v " + cmd + " > /dev/null 2>&1";
189 int r = std::system(check_command.c_str());
190 // return value of std::system is implementation defined and can be
191 // decoded using WEXITSTATUS but it should be 0 on success
192 return r == 0;
193 }
194#endif
195}
196#endif

Callers 1

print_backtrace_infoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected