file.readlines

This commit is contained in:
MihailRis 2024-05-12 19:56:38 +03:00
parent 1f3cf5ed53
commit 8054d4ba55

View File

@ -276,6 +276,15 @@ function table.tostring(t)
return s..']'
end
function file.readlines(path)
local str = file.read(path)
local lines = {}
for s in str:gmatch("[^\r\n]+") do
table.insert(lines, s)
end
return lines
end
-- Deprecated functions
block_index = block.index
block_name = block.name