added loadfile, run and srun to shutil.
This commit is contained in:
parent
b1e40cbdb3
commit
d68f8f9edd
@ -24,3 +24,15 @@ function mem()
|
|||||||
io.write(tostring(math.floor(computer.freeMemory()/1024)).."K\t")
|
io.write(tostring(math.floor(computer.freeMemory()/1024)).."K\t")
|
||||||
print(tostring(math.floor((computer.totalMemory()-computer.freeMemory())/1024)).."K\t")
|
print(tostring(math.floor((computer.totalMemory()-computer.freeMemory())/1024)).."K\t")
|
||||||
end
|
end
|
||||||
|
function loadfile(fn)
|
||||||
|
local f=io.open(fn,"rb")
|
||||||
|
local S=f:read("*a")
|
||||||
|
f:close()
|
||||||
|
return load(S)
|
||||||
|
end
|
||||||
|
function run(fn,...)
|
||||||
|
print(pcall(loadfile(fn),...))
|
||||||
|
end
|
||||||
|
function srun(fn,...)
|
||||||
|
spawn(fn,print(pcall(loadfile(fn),...)))
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user