I just want to write a file to somewhere. Here is my code:
file = io.open("test.txt", "w")
file:write("Hello World")
file:close()
but the app crashes at the first line with:
attempt to call field 'open' (a nil value)
Even trying with the Lua online console keeps up the same error.
EDITED:
Here is my screenshot of the console

Try this code to dump the keys of io:
for k in next,io do
print(k)
end
Lua online outputs:
write
Which makes sense when you think about it:
Sandboxing works by restricting what can be done, including removal of unsafe functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With