
rrdl
By:
Pinkishu on
Aug 12th, 2012 | syntax:
Lua | size: 0.69 KB | hits: 25 | expires: Never
local f = "http://dl.dropbox.com/u/18783800/rr.out"
local url = f
fName = "rr.out"
onF = http.get(url)
--file = fs.open("test","w")
test = onF.readAll()
--file.write(test)
--file.close()
onF.close()
print("Len:"..string.len(test))
index = 1
file = fs.open(fName,"wb")
local t = os.clock()
while true do
if test:byte(index) == 239 or test:byte(index) == 189 then
test = test:sub(0,index-1)..test:sub(index+1)
index = index - 1
else
file.write(test:byte(index))
end
index = index + 1
if index > string.len(test) then
break
end
if os.clock() -t >= 4 then
sleep(.05)
t = os.clock()
end
print(index)
end
file.close()
print("done")