With all my bits and pieces connected up and working, when I run the following command, assuming a text file called test.txt is already on the microSD card which contains the word hello followed by an empty line:
>var f = require("fs").readFile("test.txt");
="hello\n\n"
If, while my system is running, I remove the microSD card and re-run the above I get the following response:
>var f = require("fs").readFile("test.txt");
ERROR: Unable to read file : DISK_ERR
=undefined
replacing the card and re-running the same command still produces the DISK_ERR.
My questions:
Is this expected behaviour?
Should I implement error checking to prevent getting this error upon re-inserting the microSD card while the system is live?
If so, any suggestions how?
Temporary solution
The only way I can get the read to work again is to reset everything.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
This is a follow on from my previous discussion concerning the microSD card.
With all my bits and pieces connected up and working, when I run the following command, assuming a text file called
test.txt
is already on the microSD card which contains the word hello followed by an empty line:If, while my system is running, I remove the microSD card and re-run the above I get the following response:
replacing the card and re-running the same command still produces the
DISK_ERR
.My questions:
Temporary solution
The only way I can get the read to work again is to reset everything.