nomsu/lib/os.nom

23 lines
524 B
Plaintext
Raw Normal View History

2018-06-14 22:17:26 -07:00
use "core"
action [sh> %cmd]
lua> ".."
local result = io.popen(\%cmd)
local contents = result:read("*a")
result:close()
return contents
action [read file %filename]
lua> ".."
local file = io.open(\%filename)
local contents = file:read("*a")
file:close()
return contents
action [write to file %filename %text, to file %filename write %text]
lua> ".."
local file = io.open(\%filename, 'w')
file:write(\%text)
file:close()