MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / findSdcardFileSystem

Function findSdcardFileSystem

Tactility/Source/Paths.cpp:20–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20FileSystem* findSdcardFileSystem(bool mustBeMounted) {
21 FileSystem* found = nullptr;
22 file_system_for_each(&found, [](auto* fs, void* context) {
23 char path[128];
24 if (file_system_get_path(fs, path, sizeof(path)) != ERROR_NONE) return true;
25 // TODO: Find a better way to identify SD card paths
26 if (std::string(path).starts_with("/sdcard")) {
27 *static_cast<FileSystem**>(context) = fs;
28 return false;
29 }
30 return true;
31 });
32 if (found && mustBeMounted && !file_system_is_mounted(found)) {
33 return nullptr;
34 }
35 return found;
36}
37
38std::string getSystemRootPath() {
39 std::string root_path;

Callers 1

Calls 3

file_system_for_eachFunction · 0.85
file_system_get_pathFunction · 0.85
file_system_is_mountedFunction · 0.85

Tested by

no test coverage detected