Posted 09 April 2012 - 08:20 PM
Since i want to send a program from a computer to another computer without sending each line of the program individually over Rednet.
function sendFile(id, path)
local file = fs.open(path, "r")
if file then
local sText = file.readAll()
file.close()
rednet.send(id, sText)
end
end
function receiveWrite(path)
local file = fs.open(path, "w")
if file then
file.close()
print("File exists. Writing to "..path.."2")
file = fs.open(path.."2", "w")
end
id, filetext = rednet.receive()
file:write(filetext)
file.close()
end