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

Function create_directory

src/core/os.cpp:184–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182 }
183
184 CreateResult create_directory(const char *path)
185 {
186 CreateResult cr;
187#if CROWN_PLATFORM_WINDOWS
188 if (CreateDirectory(path, NULL) != 0)
189 cr.error = CreateResult::SUCCESS;
190 else if (GetLastError() == ERROR_ALREADY_EXISTS)
191 cr.error = CreateResult::ALREADY_EXISTS;
192 else
193 cr.error = CreateResult::UNKNOWN;
194#else
195 if (::mkdir(path, 0755) == 0)
196 cr.error = CreateResult::SUCCESS;
197 else if (errno == EEXIST)
198 cr.error = CreateResult::ALREADY_EXISTS;
199 else
200 cr.error = CreateResult::UNKNOWN;
201#endif
202 return cr;
203 }
204
205 DeleteResult delete_directory(const char *path)
206 {

Callers 3

test_filesystemFunction · 0.85
create_directoryMethod · 0.85

Calls

no outgoing calls

Tested by 2

test_filesystemFunction · 0.68