added a wget function, because wtf not
This commit is contained in:
parent
1406044789
commit
3dff3ce99e
@ -17,6 +17,7 @@ modules/lib/readline.lua
|
|||||||
modules/lib/shutil.lua
|
modules/lib/shutil.lua
|
||||||
modules/lib/sha256.lua
|
modules/lib/sha256.lua
|
||||||
modules/lib/userlib.lua
|
modules/lib/userlib.lua
|
||||||
|
modules/lib/wget.lua
|
||||||
modules/net/net-ext.lua
|
modules/net/net-ext.lua
|
||||||
modules/applications/login.lua
|
modules/applications/login.lua
|
||||||
modules/applications/luash.lua
|
modules/applications/luash.lua
|
||||||
|
12
modules/lib/wget.lua
Normal file
12
modules/lib/wget.lua
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
function wget(url)
|
||||||
|
local R=component.internet.request(url)
|
||||||
|
repeat
|
||||||
|
coroutine.yield()
|
||||||
|
until R.finishConnect()
|
||||||
|
S=""
|
||||||
|
repeat
|
||||||
|
ns = R.read(2048)
|
||||||
|
S = S .. (ns or "")
|
||||||
|
until not ns
|
||||||
|
return S
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user