local file = io.open("data.txt", "w")
file:write("1", "\n")
file:write("2", "\n")
file:write("3", "\n")
local tac = require("tac")
local scanner, err = tac.open("data.txt")
if err then error(err) end
while true do
local line = scanner:line()
if line == nil then break end
print(line)
end
scanner:close()
-- Output:
-- 3
-- 2
-- 1
tac
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||