MCPcopy Create free account
hub / github.com/bmorcelli/Launcher / createDirRecursive

Function createDirRecursive

src/webInterface.cpp:303–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303void createDirRecursive(String path) {
304 String currentPath = "";
305 int startIndex = 0;
306 launcherConsolePrintf("Verifying folder: %s\n", path.c_str());
307
308 while (startIndex < path.length()) {
309 int endIndex = path.indexOf("/", startIndex);
310 if (endIndex == -1) endIndex = path.length();
311
312 currentPath += path.substring(startIndex, endIndex);
313 if (currentPath.length() > 0 && !SDM.exists(currentPath)) {
314 SDM.mkdir(currentPath);
315 launcherConsolePrintf("Creating folder: %s\n", currentPath.c_str());
316 }
317
318 if (endIndex < path.length()) currentPath += "/";
319 startIndex = endIndex + 1;
320 }
321}
322
323int findBytes(const std::vector<uint8_t> &data, const String &needle) {
324 if (needle.isEmpty() || data.size() < static_cast<size_t>(needle.length())) return -1;

Callers 1

beginUploadTargetFunction · 0.85

Calls 1

launcherConsolePrintfFunction · 0.85

Tested by

no test coverage detected