* Format the file system and leave it mounted in an accessible state. */
| 194 | * Format the file system and leave it mounted in an accessible state. |
| 195 | */ |
| 196 | int FileSystem::format() |
| 197 | { |
| 198 | spiffs_config cfg = fs.cfg; |
| 199 | // Must be unmounted before format is called - see API |
| 200 | SPIFFS_unmount(handle()); |
| 201 | int err = SPIFFS_format(handle()); |
| 202 | if(err < 0) { |
| 203 | err = translateSpiffsError(err); |
| 204 | debug_ifserr(err, "format()"); |
| 205 | return err; |
| 206 | } |
| 207 | |
| 208 | // Re-mount |
| 209 | return tryMount(cfg); |
| 210 | } |
| 211 | |
| 212 | int FileSystem::check() |
| 213 | { |
no test coverage detected