LO
Size: a a a
R
S
R
S
f = io.open(...)
...
f:close()
R
S
R
R
S
function writefile(file, text)
local f = assert(io.open(file, "wb"))
f:write(text); f:close()
end
function appendfile(file, text)
local f = assert(io.open(file, "ab"))
f:write(text) f:close()
end
function readfile(file)
local f = assert(io.open(file, "rb"))
local data = f:read("*a")
return data, f:close()
end
Тебе не нужен цикл while f ==n il do
f = io.open(fname, "a");
end
Потому что если файл не открыт, на это есть причины, и их надо решить.R
R
R
S
R
R
S
R
R
S