• 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:

    >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.

About