Problem with the new Storage module #7604
Replies: 1 comment
-
Posted at 2019-01-16 by @gfwilliams It looks like your issue is Instead, just combine the first write and you're sorted:
http://www.espruino.com/Reference#l_Storage_read says:
Basically running Posted at 2019-01-16 by fanThomas Does the size parameter always determine the total file size even when I use it with a offset > 0? E.g.
Posted at 2019-01-16 by @gfwilliams It looks like the size gets ignored once the file itself is created. Posted at 2019-01-16 by fanThomas I found out that it does not get ignored. You can specify always the total file size. Posted at 2019-01-17 by @gfwilliams Do you have some example code? I did some tests before I wrote that reply and found that it didn't reallocate the file if the size was different. Posted at 2019-01-17 by fanThomas This is my module saver program. It works now and can be used to save modules stored on a webserver onto esp8266 flash memory. Start the program and then key in on the left side:
I had to find out the size of the module. It was stored in the header of the received code.
Altough some times i get an error which might be from a buffer overrun in the http.get module. Posted at 2019-01-18 by fanThomas I have found the problem of the mentioned error. After calling Storage.compact() the error vanished. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-01-16 by fanThomas
I am trying out the Sorage module. The example in the documentation works fine on my board. However a small change in the code brought me to a problem:
I would start with an empty file of the required size and then populate the file with content:
This results in an error:
And another question: How to determine the size of a file without reading it? The file might be bigger than the available memory and the "list()" method just lists the file name.
Beta Was this translation helpful? Give feedback.
All reactions