MCPcopy Create free account
hub / github.com/TinyMPC/TinyMPC / create_directory

Function create_directory

src/tinympc/codegen.cpp:55–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53
54
55static void create_directory(const char* dir, int verbose) {
56 // Attempt to create directory
57 if (mkdir(dir, S_IRWXU|S_IRWXG|S_IROTH)) {
58 if (errno == EEXIST) { // Skip if directory already exists
59 if (verbose)
60 std::cout << dir << " already exists, skipping." << std::endl;
61 } else {
62 ERROR_MSG(EXIT_FAILURE, "Failed to create directory %s", dir);
63 }
64 }
65}
66
67// TODO: Make this fail if tiny_setup has not already been called
68int tiny_codegen(TinySolver* solver, const char* output_dir, int verbose) {

Callers 1

Calls 1

mkdirFunction · 0.85

Tested by

no test coverage detected