local internet = require("internet") local shell = require("shell") local args, ops = shell.parse(...) local file_name = args[1] local location = args[2] print (file_name) print(location) if file_name == nil then os.exit() end local handle = internet.request("http://kat.reign-network.co.uk/opencomputers/" .. file_name) local result = "" local mt = getmetatable(handle) local code, message, headers = mt.__index.response() print(code) print(message) for chunk in handle do result = result..chunk end if location ~= nil then file_name = location .. file_name end print(filename) f = io.open(file_name, "w") f:write(result) f:close()