S
f = file.open(file_name, "w")
f:write(file_data) -- вылетает кернелпаник
Size: a a a
S
f = file.open(file_name, "w")
f:write(file_data) -- вылетает кернелпаник
S
local f = io.open(filename, "r")
local tcp = socket.connect(host, port)
local chunk = f:read(2048)
while chunk and #chunk > 0 do
tcp:send(chunk)
tcp:flush()
chunk = f:read(2048)
end
tcp:close()
Становится пофигу на размер файла и объём оперативки.А
S
appendfile
:local function appendfile(filename, data)
local f = io.open(filename, "ab+")
f:write(data); f:flush()
f:close()
end
А
appendfile
:local function appendfile(filename, data)
local f = io.open(filename, "ab+")
f:write(data); f:flush()
f:close()
end
S
А
appendfile
:local function appendfile(filename, data)
local f = io.open(filename, "ab+")
f:write(data); f:flush()
f:close()
end
S
receiver
должна вызываться много раз, как раз чанками.S
S
S
S
А