Strange behavior when using strings read from files #5280
Replies: 1 comment
-
Posted at 2022-09-15 by @fanoush what replacing And yes adding anything makes a copy of whole string. Posted at 2022-09-21 by @gfwilliams That's interesting... I'll file an issue on this (espruino/Espruino#2268) and will look into it when I have a second - it's possible that
Yes, if you perform an operation on the string the result is in RAM... Posted at 2022-10-05 by @halemmerich
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2022-09-14 by @halemmerich
I have done some experimenting with numbers read from a file and found the following two problems:
I imagine both of these are caused by the file based strings mapped directly to the file instead of living in RAM as the other strings do.
This behaviour can be worked around by prepending an empty string when reading:
Does this mean, that the whole resulting string is in RAM? Not that bad for my usecase, since I am reading a few bytes at a time from a bigger file, but could be relevant when reading whole files.
Beta Was this translation helpful? Give feedback.
All reactions