mirror of
https://github.com/bartbes/inifile.git
synced 2024-11-15 23:54:23 +00:00
Close open file handler
This commit is contained in:
parent
cdee42a3a7
commit
b7a20d1f3a
@ -36,7 +36,11 @@ local defaultBackend = "io"
|
||||
local backends = {
|
||||
io = {
|
||||
lines = function(name) return assert(io.open(name)):lines() end,
|
||||
write = function(name, contents) assert(io.open(name, "w")):write(contents) end,
|
||||
write = function(name, contents)
|
||||
local file = assert(io.open(name, "w"))
|
||||
file:write(contents)
|
||||
file:close()
|
||||
end,
|
||||
},
|
||||
memory = {
|
||||
lines = function(text) return text:gmatch("([^\r\n]+)\r?\n") end,
|
||||
|
Loading…
Reference in New Issue
Block a user