lu9: Lua for Plan 9
lu9 is a native Plan 9 port of Lua 5.4 featuring a complete Plan 9 system library, a simplified standalone interpreter, and LPeg pattern matching.
; mk
; mk install
; lu9
The p9 module provides a Plan 9 system interface to Lua programs, from basic system calls to higher-level convenience functions:
local p9 = require("p9")
-- Write to file descriptor
p9.write("hello\n", p9.fdopen(1, "w"))
-- Read file
local fd = p9.open("/path/to/file", "oread")
if fd then
local data = p9.pread(fd, 1024, 0)
print(data)
p9.close(fd)
end