Hello,
I try to write binary data in a file (so I concatened the litte b in the open function) :
[lua]local path=system.pathForFile(“data.txt”,system.DocumentsDirectory)
hdl=io.open(path,“wb”)
hdl:write(16,32,64,128,255)
io.close(hdl)[/lua]
But when I open data.txt, I read 163264128255, it means the whole numbers are converted in a string instead of writing 5 bytes. I could never read back those bytes in this case
So how to write and read binary data?
Thanks! [import]uid: 107239 topic_id: 19450 reply_id: 319450[/import]
If nobody knows how game makers can create levels editor without saving binary files!? [import]uid: 107239 topic_id: 19450 reply_id: 75151[/import]
Take a look at this : http://www.lua.org/pil/21.2.2.html [import]uid: 84637 topic_id: 19450 reply_id: 75172[/import]
Oh thank you! I think it’s what I need and I go to try all this [import]uid: 107239 topic_id: 19450 reply_id: 75267[/import]