run_command

This commit is contained in:
Yago 2014-12-17 13:01:34 +01:00
parent 258c5bfff4
commit 8775f720a6

View File

@ -111,3 +111,11 @@ function scandir(directory)
end
return t
end
-- http://www.lua.org/manual/5.2/manual.html#pdf-io.popen
function run_command(str)
local cmd = io.popen(str)
local result = cmd:read('*all')
cmd:close()
return result
end