MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / is_executable

Function is_executable

src/cli/cli.c:1070–1077  ·  view source on GitHub ↗

Check if a path exists and is executable. * On Windows, stat() doesn't set S_IXUSR — just check existence. */

Source from the content-addressed store, hash-verified

1068/* Check if a path exists and is executable.
1069 * On Windows, stat() doesn't set S_IXUSR — just check existence. */
1070static bool is_executable(const char *path) {
1071 struct stat st;
1072#ifdef _WIN32
1073 return stat(path, &st) == 0;
1074#else
1075 return stat(path, &st) == 0 && (st.st_mode & S_IXUSR);
1076#endif
1077}
1078
1079/* Search for an executable named `name` in the PATH environment variable.
1080 * Returns the full path in `out` (max out_sz) if found, else empty string. */

Callers 3

find_in_pathFunction · 0.85
cbm_find_cliFunction · 0.85
cbm_agent_cli_existsFunction · 0.85

Calls 1

statClass · 0.70

Tested by

no test coverage detected