MCPcopy Create free account
hub / github.com/defold/defold / RmTree

Function RmTree

engine/dlib/src/dlib/sys.cpp:151–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149 }
150
151 Result RmTree(const char* path)
152 {
153 #if defined(__linux__) || defined(_WIN32) || (defined(TARGET_OS_OSX) && TARGET_OS_OSX) || defined(DM_PLATFORM_VENDOR)
154 bool call_before = false;
155 Result result = IterateTree(path, true, call_before, 0, Iterate_RemoveFile);
156 if (result != RESULT_OK) {
157 dmLogError("Failed to remove file tree '%s': %s", path, ResultToString(result));
158 return result;
159 }
160 result = IterateTree(path, true, call_before, 0, Iterate_RemoveDir);
161 if (result != RESULT_OK) {
162 dmLogError("Failed to remove directory tree '%s': %s", path, ResultToString(result));
163 return result;
164 }
165 return RESULT_OK;
166
167 #else
168 dmLogOnceError("RmTree is not supported on this platform");
169 return RESULT_NOENT;
170 #endif
171 }
172
173 Result GetHostFileName(char* buffer, size_t buffer_size, const char* path)
174 {

Callers 4

SetUpMethod · 0.85
TearDownMethod · 0.85
TESTFunction · 0.85
SetupTestDataMethod · 0.85

Calls 2

IterateTreeFunction · 0.70
ResultToStringFunction · 0.70

Tested by 4

SetUpMethod · 0.68
TearDownMethod · 0.68
TESTFunction · 0.68
SetupTestDataMethod · 0.68