[0.13.6] [Oxyd] game.write_file handles data as zero terminated str
Posted: Fri Jul 08, 2016 10:44 am
I created a lua function (see viewtopic.php?f=69&t=28550), which generates an image of the map (is there a native function for it?). Therefore I wanted to write a "\0" byte out (for coal) and detected data is handled as zero terminated string and not as a buffer and length.
I expect the file to contain three bytes: "A\0B", but it contains only "A".
Code: Select all
/c game.write_file("test.txt", string.char(65, 0, 66))