forked from hkc/cc-stuff
Oopsie
This commit is contained in:
parent
24dae1a04e
commit
5594f70fe4
|
@ -11,13 +11,10 @@ if not http then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local block_size = 8192
|
|
||||||
|
|
||||||
tape.stop()
|
tape.stop()
|
||||||
tape.seek(-tape.getSize())
|
tape.seek(-tape.getSize())
|
||||||
tape.stop()
|
tape.stop()
|
||||||
|
|
||||||
|
|
||||||
local req = http.get(args[1], {}, true)
|
local req = http.get(args[1], {}, true)
|
||||||
if not req then
|
if not req then
|
||||||
print("oopsie")
|
print("oopsie")
|
||||||
|
@ -25,12 +22,10 @@ if not req then
|
||||||
end
|
end
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
local chunk = req.read(block_size)
|
local chunk = req.read()
|
||||||
if not chunk then
|
if not chunk then
|
||||||
print("EOF")
|
print("EOF")
|
||||||
end
|
end
|
||||||
for i = 1, #chunk do
|
tape.write(chunk)
|
||||||
tape.write(chunk[i])
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue