Posted 19 July 2014 - 07:54 PM
Okay so I was making a program, and all it did was open a file and send it to the other computer. The thing is it worked all the time… Until the recent update… So here is the code for the program that will open the file and send it:
EDIT: The program I am making is part of a file server…
Here is the code that send the request and then downloads it and saves it:
Now I tried doing it without the:
so I added it in and the file saves and everything but the file doesn't contain the data, it contains:
EDIT: The program I am making is part of a file server…
rednet.open("back")
print("> ID: 21")
while true do
local args = { os.pullEvent() }
if args[1] == "rednet_message" then
print("> Incoming ID: "..args[2])
local file = fs.open("DaFile", "r")
file = file.readAll()
file = textutils.serialize(file)
rednet.send(24, file)
print("> Done!")
end
end
now this will wait for any message as long as it is a rednet message.Here is the code that send the request and then downloads it and saves it:
rednet.open("top")
rednet.send(21, "give_me_da_file_biatch!")
local arg1, arg2 = rednet.receive()
print("> Server ID: "..arg1)
file = textutils.unserialize(arg2)
local f = fs.open("DaFile", "w")
f:write(file)
f:close()
print("> done!")
Now I tried doing it without the:
file = file.readAll()
but it said it cannot serialize a type?so I added it in and the file saves and everything but the file doesn't contain the data, it contains:
{}
So i really don't know what I am doing wrong :/Edited on 19 July 2014 - 05:55 PM