Appleeater, on 25 January 2013 - 05:56 AM, said:
local readFile = fs.open("<filename>", "r")
local fileTab = {}
repeat
table.insert(fileTab, readFile.readLine())
until readFile.readLine() == nil
readFile.close()
rednet.open("<side>")
rednet.send(<ID>, textutils.serialize(fileTab))
rednet.close()
That will send the file in a table, line by line.rednet.open("<SIDE>")
local id, msg, dist = rednet.receive()
local contents = textutils.unserialize(msg)
local saveFile = fs.open("<FILENAME>", "w")
for i = 1, #contents do
saveFile.writeLine(contents[i])
end
saveFile.close()
That should receive the file and save it.











