Writing to new file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Writing to new file

danilafoxpro

Hello. I have some binary data that I want to write out to a file. The file doesn't exist yet, so I want to create it as well. How would I do that in Luan?

Reply | Threaded
Open this post in threaded view
|

Re: Writing to new file

fschmidt
Administrator
local String = require "luan:String.luan"
local Io = require "luan:Io.luan"

local bin = String.to_binary("whatever")
Io.uri("file:t.bin").write_binary(bin)