lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On 4-Mar-07, at 7:22 PM, Theodor-Iulian Ciobanu wrote:

I was looking for a way to be able to redirect standard input/output
to  a file. As I couldn't find a way to do this from Lua,

-- I'd do this:
io.stdin = io.open"input.txt"
io.stdout = io.open("output.txt", "w")

-- But you can also use io.input() and io.output(),
-- with slightly different semantics