Could This Be Made Possible?

Would it be possible to do this to write data to a file:


hat would be nice :)

print, oprint and rprint are stdout functions, they don’t seem to have a redirection option in Lua when i browse for answer upon those.
When searching on storing userdata objects, i only get answers that involve C# and CPP-code.


I remember reading somewhere at that it is good practice to
have io be redirectable from lua, but I cannot find the post. Could be I am
misunderstanding something.

Anyway, this was just a “nice to have” thought.