Hi,
Could someone explain to me why this is crashing max every time ?
I’m losing sanity.
(
file = "C:/a.txt"
fs = openfile file mode:"r+" encoding:#utf8
a = readLine fs
a += "tata"
flush fs
close fs
)
a.txt contains whatever string like toto
It crashes when i add the string “tata” to string a
If i do :
b = copy a
–in listener “toto”
b += “tata”
i get 翼tata
wtf
I thought it had something to do with the text file encoding, but i’m stuck
Thanks !
Looks like it has more to do with the mode, because mode:“rt” is working.
I guess i could close the file after reading it and reopen it or recreate it to write stuff.
Still how is that read/write mode meant to work ? Bug ? Feature ? Who knows…