| 223 | } |
| 224 | |
| 225 | int 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 | |
| 253 | int FileSystem::setProfiler(IProfiler* profiler) |
| 254 | { |
no test coverage detected