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

Method getinfo

Sming/Libraries/Spiffs/src/FileSystem.cpp:225–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225int FileSystem::getinfo(Info& info)
226{
227 info.clear();
228 info.partition = partition;
229 info.type = Type::SPIFFS;
230 info.maxNameLength = SPIFFS_OBJ_NAME_LEN - 1;
231 info.maxPathLength = info.maxNameLength;
232
233 if(SPIFFS_mounted(handle())) {
234 info.volumeID = fs.config_magic;
235 info.attr |= Attribute::Mounted;
236#ifndef SPIFFS_STORE_META
237 info.attr |= Attribute::NoMeta;
238#endif
239 u32_t total, used;
240 SPIFFS_info(handle(), &total, &used);
241 info.volumeSize = total;
242 // As per SPIFFS spec
243 if(used >= total) {
244 info.attr |= Attribute::Check;
245 } else {
246 info.freeSpace = total - used;
247 }
248 }
249
250 return FS_OK;
251}
252
253int FileSystem::setProfiler(IProfiler* profiler)
254{

Callers 1

fileGetSystemInfoFunction · 0.80

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected