From a78b14f8315d86b13ff9271659e84b2043f6bdc4 Mon Sep 17 00:00:00 2001 From: Kamil Kaminski Date: Sun, 11 Dec 2011 03:33:38 -0600 Subject: initial commit --- file.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 file.lua (limited to 'file.lua') diff --git a/file.lua b/file.lua new file mode 100644 index 0000000..6e55b3f --- /dev/null +++ b/file.lua @@ -0,0 +1,10 @@ +-- writing to a file -- +fd = io.open("my.txt", "a") +io.output(fd) +io.write("a hello message from Lua, bro!\n") +io.close() + +for line in io.lines("my.txt") do + print(line) +end + -- cgit v1.2.3