" none of the following works as is shown in the example. "
It appears the snippet is reading and writing to a file as expected, but the snippet is not identical to the code example at http://www.espruino.com/ESP32
Would you please post your code in it's entirety as one legible code block so that we may determine the differences between that shown in the above page and that in the snippet that is proving difficult.
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.
@user80339,
It appears the snippet is reading and writing to a file as expected, but the snippet is not identical to the code example at http://www.espruino.com/ESP32
Would you please post your code in it's entirety as one legible code block so that we may determine the differences between that shown in the above page and that in the snippet that is proving difficult.