MCPcopy Create free account
hub / github.com/SmingHub/Sming / listSpiffsPartitions

Function listSpiffsPartitions

samples/Basic_Storage/app/application.cpp:11–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9IMPORT_FSTR(FS_app, PROJECT_DIR "/app/application.cpp")
10
11void listSpiffsPartitions()
12{
13 Serial.println(_F("** Enumerate registered SPIFFS partitions"));
14 for(auto part : Storage::findPartition(Storage::Partition::SubType::Data::spiffs)) {
15 Serial << _F(">> Mounting '") << part.name() << "' ..." << endl;
16 bool ok = spiffs_mount(part);
17 Serial.println(ok ? "OK, listing files:" : "Mount failed!");
18 if(!ok) {
19 continue;
20 }
21
22 Directory dir;
23 if(dir.open()) {
24 while(dir.next()) {
25 Serial << " " << dir.stat().name << endl;
26 }
27 }
28 Serial << dir.count() << _F(" files found") << endl << endl;
29 }
30}
31
32void printPart(Storage::Partition part)
33{

Callers 1

initFunction · 0.85

Calls 8

spiffs_mountFunction · 0.85
printlnMethod · 0.80
findPartitionFunction · 0.50
nameMethod · 0.45
openMethod · 0.45
nextMethod · 0.45
statMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected