Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 510 Bytes

README.md

File metadata and controls

27 lines (21 loc) · 510 Bytes

tac GoDoc

Usage

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