conf = fs.open('/etc/ftpd.conf','r') export_path = conf.readLine() while 1 do local senderId, message, distance = rednet.receive() query=textutils.unserialize(message) if query[1] == 'FTP' then print('Got request for '..query[2]..' from '..senderId) if fs.exists(export_path..query[2]) then local reply_file = fs.open(export_path..query[2],'r') reply_file=reply_file.readAll() reply = textutils.serialize({'FTP',1,reply_file}) rednet.send(senderId,reply) else reply=textutils.serialize({'FTP',0}) rednet.send(senderId,reply) end end end