• Having just looked into this a bit more, I could detect the specific DISK_ERR and automatically unmount the disk, but this causes some real problems because if you open the same file that you had open before, the filesystem doesn't need to access the disk. That means that you'll get all the way to trying to read the file before it fails.

    I'll add an E.unmount() command to explicitly unmount the disk - and if you plan on pulling out the SD card while Espruino is running, you can call it after every filesystem command and it'll mean you can then remove the SD card afterwards.


Avatar for Gordon @Gordon started