diff options
Diffstat (limited to 'file.lua')
-rw-r--r-- | file.lua | 10 |
1 files changed, 10 insertions, 0 deletions
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
+
|